Discord.js: Guild Delete event error

Created on 1 May 2019  Â·  1Comment  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
Got a random error on guild delete event.

Include a reproducible code sample here, if possible:

TypeError: Cannot read property 'get' of undefined
    at Guild.get voice [as voice] (/home/koyamie/Koya/node_modules/discord.js/src/structures/Guild.js:397:29)
    at GuildDeleteAction.handle (/home/koyamie/Koya/node_modules/discord.js/src/client/actions/GuildDelete.js:40:17)
    at Object.module.exports [as GUILD_DELETE] (/home/koyamie/Koya/node_modules/discord.js/src/client/websocket/handlers/GUILD_DELETE.js:4:30)
    at WebSocketManager.handlePacket (/home/koyamie/Koya/node_modules/discord.js/src/client/websocket/WebSocketManager.js:388:31)
    at WebSocketShard.onPacket (/home/koyamie/Koya/node_modules/discord.js/src/client/websocket/WebSocketShard.js:411:22)
    at WebSocketShard.onMessage (/home/koyamie/Koya/node_modules/discord.js/src/client/websocket/WebSocketShard.js:265:10)
    at WebSocket.onMessage (/home/koyamie/Koya/node_modules/discord.js/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:193:13)
    at Receiver.receiverOnMessage (/home/koyamie/Koya/node_modules/discord.js/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:193:13)
    at Receiver.dataMessage (/home/koyamie/Koya/node_modules/discord.js/node_modules/ws/lib/receiver.js:413:14)
    at Receiver.getData (/home/koyamie/Koya/node_modules/discord.js/node_modules/ws/lib/receiver.js:352:17)
    at Receiver.startLoop (/home/koyamie/Koya/node_modules/discord.js/node_modules/ws/lib/receiver.js:138:22)
    at Receiver._write (/home/koyamie/Koya/node_modules/discord.js/node_modules/ws/lib/receiver.js:74:10)
    at doWrite (_stream_writable.js:415:12)
    at writeOrBuffer (_stream_writable.js:399:5)

Further details:

  • discord.js version: lastest master
  • Node.js version: 11.14.0
  • Operating system: debian 9
  • Priority this issue should have – please be realistic and elaborate if possible:
  • [x] I have also tested the issue on latest master, commit hash:
medium voice bug

Most helpful comment

The error seems to be caused by Guild#voiceStates somehow being undefined, let me investigate a little further

EDIT: Think I found it, it might be because the guild is no longer available, the event does actually emit when the guild goes into outage, would explain how the error occured

>All comments

The error seems to be caused by Guild#voiceStates somehow being undefined, let me investigate a little further

EDIT: Think I found it, it might be because the guild is no longer available, the event does actually emit when the guild goes into outage, would explain how the error occured

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lombra picture Lombra  Â·  3Comments

tom-barnes picture tom-barnes  Â·  3Comments

ghost picture ghost  Â·  3Comments

ghost picture ghost  Â·  3Comments

BrandonCookeDev picture BrandonCookeDev  Â·  3Comments