Closed kawaii closed 2 years ago
From Sinister Rectus in the Discord API developers server;
if you don't disconnect gracefully, then you'll just have a zombied connection that discord will eventually terminate after it doesn't detect a heartbeat. it takes up to about a minute and during that time your bot will appear online (or with its last status and activity) despite not having a real client behind it, so that can be misleading to your users. i believe code 1000 is the appropriate code for a clean disconnect. i think the library should send and you should not rely on users to send i
Probably this https://github.com/shuppet/raku-api-discord/pull/58
Note optional :script-mode
that handles SIGINT for you
We should add a
disconnect
method which sends a1000
close code to the websocket. This will allow for graceful shutdown of applications and prevent zombie connections while the heartbeats time out.@gfldex asked about this in the Discord, just making a note of it here for later.