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:
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
Most helpful comment
The error seems to be caused by
Guild#voiceStatessomehow being undefined, let me investigate a little furtherEDIT: 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