How to keep your discordant bot alive in Repl.it (2020)
This is simple and works (at least for now).
First thing, we have some code to put on your index.js
file or your file that has the token and some code.
put this code on the very top of the file.
const express = require('express'); const app = express(); const port = 3000; app.get('/', (req, res) => res.send('Hello World!')); app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`));
Then hit run and you shall see something pop up. A white screen on top of the terminal.
next go to Uptime Robot
And if you dont have a uptimerobot account, please create one.
Next go to your Dashboard
and click +Add New Monitor
then select the type of monitor yo be HTTP
. Next you will name the monitor. you can name it whatever you want. Then enter the the link to your replit. Copy the link that is on top of the terminal and the white screen and paste it in the place where you put your https.
Next you also have to choose what type of contact forms of when your Monitor goes down or gets up, so select your email and then Create the Monitor.
Your done! If you want to try it, exit out of your Discord bot replit and try some commands. The commands will work if you did it correctly.
Here is my example.
and remember to put your token in the bottom space for this to work