Bug Report
When starting a trivia game several days after the lobby was created, it errors rather than starting the game.
Expected Behavior
The game should start normally.
Code Example or Reproduction Steps
- Start a trivia game.
- Let KekBot accumulate a bunch of garbage so the guild cache's UpstreamReference becomes invalid.
- Try to start a game.
The error is very clear what's happening in the JDA side, but since the Game class holds onto the guild reference only, it can't recreate the guild from its id. It should probably check if the reference exists, and if it doesn't, it should recreate it from the id and replace the reference. TextChannels, Guilds, etc. are ephemeral and are held only by WeakReferences. You could also force it to hold onto the reference by getting the channel and setting it as a member of the Game object, since that would hold a strong reference to it.
Exception or Error
traceback.txt
Bug Report
When starting a trivia game several days after the lobby was created, it errors rather than starting the game.
Expected Behavior
The game should start normally.
Code Example or Reproduction Steps
The error is very clear what's happening in the JDA side, but since the Game class holds onto the guild reference only, it can't recreate the guild from its id. It should probably check if the reference exists, and if it doesn't, it should recreate it from the id and replace the reference. TextChannels, Guilds, etc. are ephemeral and are held only by WeakReferences. You could also force it to hold onto the reference by getting the channel and setting it as a member of the Game object, since that would hold a strong reference to it.
Exception or Error
traceback.txt