#bot keeps dying
1 messages ยท Page 1 of 1 (latest)
I can't help you right now, but I wanna ask you for some info, so someone else can faster help you
Are you using the last i.py update?
pip freeze
What python version are you using?python --version(linux) orpy --version(windows)
What hosting are you using. Are you sure it's not problems on the hosting side?
For how long it's happening? Maybe it's one-time discord problem
Nah it happens all the time
i'm using python 3.12.2
I'm using 5.11 but this was a problem on all versions
and Im using linode to host
tag me in future
i'd suggest using 5.12 first of all, it fixed a couple of bugs relating to reconnects
This happens all the time on all versions
well yes 5.12 fixed some issues there especially on 3.12
but also: the bot dying after a decent period of time is completely normal, some fuckery happens with networking sometimes that just messes up any long lasting program
you should be running your bot in some sort of manager (systemctl, pm2, docker) that handles that
In all 3 cases, they will restart the bot if it crashed.
I'm currently having problems with the bot's connections just dropping
- Is there any external module that could detect when the connection drops and restarts it for me?
- Isn't that an issue with discord-interactions-py that should be considered for future updates? Apparently discord.py automatically restarts when the connection dies.
@swift dune
for 2, interactions.py does try to automatically restart
it just doesn't seem to be working for your particular scenario which is, needless to say, hard to debug ๐
๐ญ
not sure about 1, that depends on a lot of things
I'll try figure something out for 1
i will say that AutoShardedClient does have a few issues with the reconnection logic that i've not been able to properly narrow down, though Client has always worked for me
I'm just using Client
Does that look good?
Idk
I also very commonly get this error in my console for no apparent reason
POST::https://discord.com/api/v10/interactions/1307303369353990194/aW50ZXJhY3Rpb246MTMwNzMwMzM2OTM1Mzk5MDE5NDpTZjhjQzJRUGlJTXFsRTJBbWtMT1N0eExJUDNEbmdvb01jY3EyU2dnN2lRblhlQ2JEZnJCR09oMnFCZmwwckQ4SFIwQ3VTMHBncm5LVHVKZ0dtV2FPN2oxQWxvWFhKZ1l4bVprNG1RUGJFcmxBSnFDcFZwYVB5WTZHd04zVzRkMw/callback: 400
Normally it tells u the error after that
But it just sends that
@swift dune
looks fine
this happens on occasion, its just discord being discord as far as i can tell
not a major deal and it shouldnt be taking the bot offline
@full knoll did you end up figuring this out?
I am getting error 400 too randomly when I have a Button that would open a Module
It doesn't cause the Bot to stop but stops the Module from being sent
Actually I'll create a separate ticket for it since it's a different result tho it's the same error code
Hmm I'm trying to reproduce the issue by performing the command multiple times but it's not happening now
As far as I can tell, the only thing I'm noticing is that it has more chance of appearing if a user clicks it for the first time in some days (?)
is the button not working after you restart your bot?
send the error
After restarting the Bot, or just re-running the command without even restarting, it works just fine
It happens at random
Idk if it's relevant but it has a timeout
try:
await self.client.wait_for_component(
components=interactions.ActionRow(hit_fragment_btn, skip_btn),
check=self.fragment_check,
timeout=self.question_timeout
)
except:
await self.ctx.edit(components=[])
self.current_question = None```
id probably ignore the error if it doesnt tell u anything after callback
does it make ur code not work?
then the button probable timed out
right?
It should not
Unless it's off, I have the timer printed with Discord time style there and I have still time
theres no real fix to it other than having people try it again
theres probably some timing stuff or network stuff thats causing it - hard things to debug
Might be that it goes off in the exact moment the timer ends?
nah
I don't really know at this point
it happens on my commands without a timer
im partially convinced its just discord being discord
im partially convinced its some edge case bug in ipy
Doesn't seem to happen in a similar Bot that uses Discord.py
its really hard to know ๐
Oh you mean interactions.py right?
yes
i'll probably dig into it one day
likely has to do with how we make requests
but that hasnt been touched in a while
