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?
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.
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!
@Coder100 Hey, in the first option, it still goes offline, and the second one keeps saying “authentication failed”.
hmmm... send the repl in question @JollyJack8
@Coder100 like my file?
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
@Coder100 so I did that, but now the commands don’t work, the bot is just idle online.
no no, don't replace the entire code into somewhere else!! Add the code along with the bot code @JollyJack8
@Coder100 I did. I put it in server.js, and it also went offline again.
that's because
server.js
isn't run. So, just add this to index.js:@JollyJack8
@Coder100 omg tysm it works so well! c:
no problem!! (: @JollyJack8
how to do in python?
@Coder100
@Coder100 i used the code you provided above, but still the bot if offline :(
