Fix AFK Handler
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>()
tologger.<fun>{ }
to take advantage of laziness and use enclosing context - Simplify
try/catch
logic in thedisconnect()
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!