Make graceful shutdown more graceful
Currently, "graceful" shutdown (.system shutdown
) works by calling Client.logout
, which effectively just logs out of Discord. This results in what's effectively incomplete command execution as visible to users and possibly the database.
This should be changed such that the command:
- Disables acceptance of new commands
- Stop all long-term tasks (e.g. automatic map rotations and Cephalopop)
- Wait for all short-term tasks to complete (e.g. commands)
- Then disconnects from Discord