Logout on shutdown with ShardingManager
Hello, I am currently trying to make my bot immediately "log out" i.e., appear offline on Discord as soon as my bot process exits.
I take for granted that I need to use
client.destroy() for this, however when trying to implement this with the ShardingManager I get some weird behaviour where when I hit Ctrl + C the client is destroyed and then immediately re-runs, hitting Ctrl + C again stops the process but throws an exception
This is my current implementation
3 Replies
Is that a default option? This is my ShardingManager
I don't do any auto-restarts to my knowledge. Right now I'm just running the bot with
tsx src/client.ts and no fancy stuff in the bot file.
Alright, disabling that seems to have fixed it. ThanksThe thread owner has marked this issue as solved.