Interaction already replied on bot restart
Hello, I am getting the interaction already replied when my bot re-deploys after changes are pushed to github.
It seems that two instances of the bot are probably running for a split second causing one bot to reply and the other to error out as the interaction has been replied to.
This only happens if I run a command as soon as it's deployed - if I wait a little its fine (presumably the other bot is dead by then)
I am using Digital Ocean. See the code below for termination:
I see a SIGTERM signal should be sent by DO but I don't see any of my logging in the runtime logs, the bot just restarts.
Do I need to change anything in my bot code? Or change my DO setup? Any help appreciated!
4 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!I’ve never needed to use shutdown procedures on D.O. Bots, but if you needed to you could setTimeout the client.login a bit, which would give you a little breathing room.
Ah, so basically delaying the bot logging up by some time? Let the old deployment completley exit
Have you're bots been ok then? No overlap in interactions when a new deployment goes live?
Aside from network connectivity issues recently, my bots haven't had that issue. When it kills the process it's gone