Skip to content
Sign upLog in
← Back to Community

How to host a discord bot on (Repl.it).

Profile icon
JUGisMUGlol

So I've been developing a discord.js bot using node.js in (Repl.it) but I am un-able to understand that how to host a discord.js bot on (Repl.it). Btw im using the [node.js] language if it is related;

Voters
Profile icon
HectorBernabe
Profile icon
nvmghry
Profile icon
OMM2135
Profile icon
JUGisMUGlol
Comments
hotnewtop
Profile icon
PattanAhmed

@JUGisMUGlol
Hi,
Read this website:-
Click here

For your side note, if you need the full tutorial then,
Click here

That's it
Thanks!

Hope this helps

Profile icon
OMM2135

hi bro
i am also having same problem

Profile icon
JUGisMUGlol

@OMM2135
bruh see the answers to this issue, this issue was solved.

Profile icon
Coder100
  • Make an HTTP server
  • Use uptimerobot to ping the newly created HTTP server (root domain should be .repl.co).
  • Success!
Profile icon
JUGisMUGlol

@Coder100
How to create a HTTP server? And where to get the root domain to use in UpTimeRobot? And even when my browsers is on. The bot is sitting offline. Should I try heroku to host or nah?

Profile icon
Coder100

@JUGisMUGlol
As in:

require("http").createServer((_, res) => res.end("Alive!")).listen(8080)
Profile icon
JUGisMUGlol

@Coder100
Alright, So I need to put that in the start of the [index.js]?

Profile icon
JUGisMUGlol

@Coder100
So I need to paste that code in (index.js) and then make a monitor in UpTimeRobot with interval of 5 minutes and the code ans the URL i need to add in the monitor as a HTTP is [.repl.co]

Profile icon
Coder100