Ask coding questions

← Back to all posts
Repl.it File Isn't Running 24/7 Even Though I Linked Uptimerobot To It
[deleted]

Hi there! I had just made a new discord bot using repl, and I hooked it up to uptime robot to keep it running, but the bot keeps going offline every two minutes or so, so then I have to open up the project and run it again. Is there something that I am doing wrong?

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
DheiryaTyagi
2004105010047
MirandaLopes
josysalt
Comments
hotnewtop
Coder100

Hello, there are other options other than uptimerobot. Try these along with it as well: mat's ping, official (beta) keeper-upper of repl.it.

Hopes this helps!

Also, be sure to mark as correct answer if it has helped you!

[deleted]

@Coder100 Hey, in the first option, it still goes offline, and the second one keeps saying “authentication failed”.

Coder100

hmmm... send the repl in question @JollyJack8

[deleted]

@Coder100 like my file?

Coder100

oh, nvm. Ok, so the problem is that you have no HTTP server! Http servers is what makes the bots stay alive (a terminal app shuts down after you close the tab, but a web server shuts down after 1 hour of no activity). So, just add this to your code (anywhere in the file):

and your bot will work!
@JollyJack8

[deleted]

@Coder100 so I did that, but now the commands don’t work, the bot is just idle online.

Coder100

no no, don't replace the entire code into somewhere else!! Add the code along with the bot code @JollyJack8

[deleted]

@Coder100 I did. I put it in server.js, and it also went offline again.

Coder100

that's because server.js isn't run. So, just add this to index.js:

@JollyJack8

[deleted]

@Coder100 omg tysm it works so well! c:

Coder100

no problem!! (: @JollyJack8

josysalt

hey first change ur bots status to streaming. then it will work

[deleted]

@josysalt I did that but it still keeps going offline. Now sometimes it’s just sitting use not responding to any commands

josysalt

@JollyJack8 hmm... weird. is it js? cuz for me it works with py. ill give u template if u need.

[deleted]

@josysalt yeah it’s js. Like, I did the stream and it says online, but if I run a command, it just stays idle and doesn’t respond. And sometimes it just goes offline altogether.