Skip to content

Fix AFK Handler

Jose V. Trigueros requested to merge fix-afk-counter into master

Whenever a voice channel was left because there was nobody speaking, the bot would abruptly leave triggering an InterruptedException on the AudioHandler. According to this issue on JDA, the correct approach is to disconnect on a separate thread.

Furthermore, there were a few other things that were fixed in the process:

  • Convert logger.<fun>() to logger.<fun>{ } to take advantage of laziness and use enclosing context
  • Simplify try/catch logic in the disconnect() function in the AudioHandler
  • Mark Discord-only recordings as such on the database, and don't create entries for empty recordings

I'm hoping this patches some of the issues with creating too many PIDs!

Merge request reports