LakeYS / Discord-Trivia-Bot

TriviaBot: Play trivia in Discord! Powered by discord.js and OpenTDB, with 24 categories and three modes of play.
http://lakeys.net/triviabot/
Apache License 2.0
84 stars 39 forks source link

Failover export error "Cannot read property 'createDM' of undefined" #178

Closed LakeYS closed 3 years ago

LakeYS commented 4 years ago

This happened during startup as the failover handler re-assigned files to a new shard count.

Game exported to ./game.0.json.bak
/home/server/TriviaBot/triviabot.js:1478
      channel.createDM()
              ^

TypeError: Cannot read property 'createDM' of undefined
    at triviaResumeGame (/home/server/TriviaBot/triviabot.js:1478:15)
    at Object.keys.forEach (/home/server/TriviaBot/triviabot.js:1652:7)
    at Array.forEach (<anonymous>)
    at Object.Trivia.importGame (/home/server/TriviaBot/triviabot.js:1643:21)
    at Client.global.client.on (/home/server/TriviaBot/triviabot.js:1699:12)
    at Client.emit (events.js:198:15)
    at WebSocketConnection.triggerReady (/home/server/TriviaBot/node_modules/dis
cord.js/src/client/websocket/WebSocketConnection.js:125:17)
    at WebSocketConnection.checkIfReady (/home/server/TriviaBot/node_modules/dis
cord.js/src/client/websocket/WebSocketConnection.js:141:61)
    at GuildCreateHandler.handle (/home/server/TriviaBot/node_modules/discord.js
/src/client/websocket/packets/handlers/GuildCreate.js:13:31)
    at WebSocketPacketManager.handle (/home/server/TriviaBot/node_modules/discor
d.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
LakeYS commented 3 years ago

Stale