Skip to content
← Back to Community
How to do your bot 24/7
Profile icon
SneakyCatYT

From, past 7 days I have been seeing some people are searching for "how to get your discord bot 24/7" and a lot of them don't work or some of you don't understand in this tutorial I will be telling you how do we really add uptime robot to your discord bot!
first when you make your discord bot in https://repl.it go and make a new file and name it "server.js" and paste this code there.

const express = require('express');

const server = express();

server.all('/', (req, res)=>{
res.send('Your bot is alive!')
})
function keepAlive() {
server.listen(3000, ()=>{console.log("Server is ready!")});
}
module.exports = keepAlive;

and when finished head to index.js where you create your commands and go to the 1 line and type this "const keepAlive = require("./server.js")"
where your client.login is of that up type there this "keepAlive();"

and then go to https://uptimerobot.com/ create and account and then go and create a monitor and select HTTPS(s) and type a friendly name for your bot and then run your bot then there will be a link in the terminal and then copy that and paste it in the url box and click create monitor

That's it
Thank you
Sneaky cat

Voters
Profile icon
MOHAMEDRY
Profile icon
SneakyCatYT
Comments
hotnewtop
Profile icon
IntellectualGuy

There is the new always on repls for hacker plan...

Profile icon
SneakyCatYT

@IntellectualGuy I am not hacker

Profile icon
Silverwolf7

it says express is not defined

Profile icon
SneakyCatYT

@Silverwolf7 yah its expired now