Ask coding questions

← Back to all posts
My Discord Bot Program Keeps Stopping Randomly
BraedenF1

I am currently using the UptimeRobot strategy to keep my program running at all times of the day. But it has randomly been stopping on it's own and I have no idea how to fix it. Please help!

Voters
BraedenF1
Comments
hotnewtop
Geocube101

Either an internal error (best to keep a log file to debug) or the repl restarting. UptimeRobot is good at keeping a repl up but cannot stop the occasional restart replit does

BraedenF1

@Geocube101 Okay so I think that's the issue. I think replit restarts occasionally but it fails to do so, because for some reason it isn't remembering one of my pip install's. Every time I return after noticing it was off, it has an error, and says to install a particular pip. So I do that every time, run it, and it works. But not when Replit restarts I guess. So any idea why it isn't saving my pip?

Geocube101

@BraedenF1 Pips are lost on reset. Replit uses a different package manager but you should be able to specify both the package and version inside of the pyproject.toml file. Or you could manually call the pip command from inside the code.

BraedenF1

@Geocube101 I'm not sure honestly how to do that. Could you help me out. Thanks for everything so far btw! What I use to install through the shell is.. "pip install pymongo[srv]"

Geocube101

@BraedenF1 Ok so you can either use the os module or the subprocess module

BraedenF1

@Geocube101 Thank you so much for your help!

BraedenF1

@Geocube101 So I thought my problem was fixed, and I guess one of them was. But I woke up this morning and the program/web server just wasn't running anymore. No errors in the console or anything. It just wasn't running. Any clue why that is?

Geocube101

@BraedenF1 I don't know why that is. Most likely something on replit's side. Maybe a kill signal, if so there is nothing you can do.

BraedenF1

@Geocube101 darn. thanks anyway!

LordSoloOfficial

1) Make Sure You Have The Correct Link On Uptimerobot.

2) See If Your Wifi Is Good Because If Your Wifi Is Bad It Might Stop.