#bot keeps dying

1 messages ยท Page 1 of 1 (latest)

distant briarBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

charred shoal
#

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) or py --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

full knoll
#

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

swift dune
full knoll
swift dune
#

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

graceful bay
#

I'm currently having problems with the bot's connections just dropping

swift dune
#

yeah i dont notice that

#

not sure whats the cause then

graceful bay
#
  1. Is there any external module that could detect when the connection drops and restarts it for me?
  2. 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

swift dune
#

it just doesn't seem to be working for your particular scenario which is, needless to say, hard to debug ๐Ÿ˜…

graceful bay
#

๐Ÿ˜ญ

swift dune
#

not sure about 1, that depends on a lot of things

graceful bay
#

I'll try figure something out for 1

swift dune
#

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

graceful bay
#

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

swift dune
swift dune
#

not a major deal and it shouldnt be taking the bot offline

graceful bay
lean pebble
#

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

graceful bay
#

just show m here

#

ill try help u

lean pebble
#

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 (?)

graceful bay
#

is the button not working after you restart your bot?

lean pebble
lean pebble
#

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```
graceful bay
#

id probably ignore the error if it doesnt tell u anything after callback

#

does it make ur code not work?

lean pebble
#

It makes it not work because the Modal is not appearing

#

Modal sorry

graceful bay
#

right?

lean pebble
#

It should not

#

Unless it's off, I have the timer printed with Discord time style there and I have still time

swift dune
#

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

lean pebble
#

Might be that it goes off in the exact moment the timer ends?

swift dune
#

nah

lean pebble
#

I don't really know at this point

swift dune
#

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

lean pebble
#

Doesn't seem to happen in a similar Bot that uses Discord.py

swift dune
#

its really hard to know ๐Ÿ˜…

lean pebble
swift dune
#

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

lean pebble
#

Thank you so much, don't stress you though

#

Can I partially screenshot this chat to send it to a guy I'm working on the Bot with? I'll cut off your Discord name

#

Just to prove it's not on me lol

swift dune
#

you can show my name lol

#

im literally one of the major devs fukt