Interactions randomly fail in a dockerized bot
I am not sure if this is inherently a sapphire thing or a discord.js thing but
My bot (code found here ) has a weird issue to it where it would occasionally just fail commands entirely https://alex.thefoxesare.online/powershell_vFxRKxUOPM.png without any reason in particular. A recurring problem was when a command I don't have permission to run is run and then any command after it would cause the unknown interaction error to happen, sometimes other interactions. I have never seen this happen in a locally hosted instance so I'm not exactly sure what's happening here.
The VPS that the docker instance is on has 2GB of RAM and more than enough CPU and I haven't been hitting any of those limits.
After the unknown interaction error, the bot would shut down shortly after.
The only other detail I necessarily have is that I'm using global commands and I restarted the bot a few times along with tryong to prun the commands and recreate them but it persists
Solution:Jump to solution
The makeshift solution is to prevent people from executing interactions for like 5 minutes or something. I don't have anything else to give for this particular problem.
14 Replies
I did not test this by dockerizing on my PC (which probably would've been a smart idea to do instead of on the VPS? Which is a valid thing to test but besides that I haven't really had the problem of commands failing on me like that
I wonder if turning the bot off and back on continuously on the VPS lead to some sort of ratelimit type of thing but as far as I know there is a separate kind of error for something like that happening
Can it just be written off as "slash commands be slash commands" because of the bot being consecutively restarted
I think that your interactions are timing out really quickly
More like the VPS is having a slow internet connection🤔
Anyways, if you add deferred responses and still this is a problem, I think that there is some underlying problem in DJS itself🤔
I appreciate it I'll give it a shot
Doesn't look like it
Is it literally all fault of the VPS being slow
Try the same code locally in your PC
I checked the code for ping command and it does look correct
Yea it never did that there
You mean, in your local PC, you didn't encounter such problem?
If yes, then I suppose that the internet connection or performance of your VM is slow
Maybe try in a different VM/VPS?
Yeah, probably the way to go, that's so annoying
Oh well, ty
Don't forget to mark solution once your bot starts working
I'm not sure if it is yet :LUL:
It seems to be an isue that specifically happens with interactions upon the bot is being freshly restarted. Don't know if there's a specific downtime when discord interactions / application commands just don't respond / exist?
Solution
The makeshift solution is to prevent people from executing interactions for like 5 minutes or something. I don't have anything else to give for this particular problem.