Ask coding questions

← Back to all posts
“Always On” Telegram Bot crashes frequently requiring restart
CruzinY (0)


I have a bigger project that was crashing so I just made this simple one to see if it also crashes with the same error messages, and yes it does (refer attached images for code and crash logs).

Always On is turned ON.

Does anyone know why this might be ? I’m hoping that because its happening with such simple code that the solution will be very simple too! Thanks for the help.

InvisibleOne (3197)

I believe that that is Discord resetting the connection

CruzinY (0)

@InvisibleOne It’s a Telegram bot. Are you suggesting Telegram is resetting the connection ?

InvisibleOne (3197)

Sorry, I meant to say Telegram, and yes. If it says the peer is resetting the connection then that probably means the peer is resetting the connection. @CruzinY

CruzinY (0)

Ok and do you know why replit is responding by crashing ?, requiring a manual restart ? Is it normal that a peer resetting a connection would cause the repl to crash.

Do you know if there is a way to make my repl auto-restart following a crash like this ? Or do you have any other suggestions on how I can work through this to resolve the issue ? @InvisibleOne

CruzinY (0)

Okay so I have been able to validate that this issue is only happening via I ran the same script (multiple occurrences, multiple bots) on my own server and they have not failed in over 24hrs. Doing the same tests via and they fail frequently, sometimes 30 minutes other times after a few hours. What are your thoughts as to why ‘peer is resetting the connection’ only when the script is being run via ?

InvisibleOne (3197)

Replit servers reset repls every 24 hours I think it is, and then restart them. It isn't really the best place for hosting things that you want constant uptime on. @CruzinY

CruzinY (0)

So now you are suggesting that the reason my scripts on crash multiple times within 24 hours with error ‘connection reset by peer’ is because Replit servers reset repls once every 24 hours ? I would suggest you don’t respond to posts where you don’t have enough technical understanding to be able to assist the person who needs help. Your responses have provided zero benefit so far, and have caused me to waste several hours on top of that. @InvisibleOne