Skip to content
← Back to Community
Hosting a Discord bot on Repl
Profile icon
Kiansjet

Hello!

Real quick, I have a stupidly simple NodeJS Discord.js Discord bot I wrote. Am I able to just run it on Repl? I remember seeing a banner saying I could host sites on Repl. Is there a rule against this? Is there an amount of time a Repl VM will run before terminating?

Answered by Zavexeon [earned 5 cycles]
View Answer
Voters
Profile icon
DanilSanjaya
Profile icon
RamiKhader
Profile icon
haghest
Profile icon
PandamasterLi
Profile icon
TwertleBwo
Profile icon
SuperTux20
Profile icon
Kiansjet
Comments
hotnewtop
Profile icon
Zavexeon

Yes, you can using uptimerobot, like @Vandesm14 and @ash15khng said. I'll give you step by step instructions. Please note that your repl will need a front end (an HTML page).

  1. ) Create an account at https://uptimerobot.com/
  2. ) Login and go to your dashboard on uptimerobot
  3. ) Click "Add New Monitor"
  4. ) In the menu that pops up, set monitor type as "HTTP(S)", give it a friendly name (can be anything you want), and set the URL as the link to the front end (the repl.co one).
  5. ) Set the monitoring time to 30 minutes or less.
  6. ) Click "Create Monitor" at the end of the form.
Profile icon
tradlimb

@Zavexeon How do I create the front end?

Profile icon
Zavexeon

@DomLowe What language?

Profile icon
tradlimb

@Zavexeon Node.JS

Profile icon
Zavexeon

@DomLowe An easy way to create a front end is

require('http').createServer((req, res) => res.end('Bot is alive!')).listen(3000)
Profile icon
Skysea28957

@Zavexeon is this also works on a html project?

Profile icon
EmiXD

In the index.js ? and if so, in which line? @Zavexeon

Profile icon
Vandesm14

You are allowed to host a Discord bot on repl.it
If you use Uptime Robot and setup a ping/http monitor to ping your repl, you can keep it alive forever!

Please mark this as answered if I helped your problem 👍

Profile icon
ash15khng

It will terminate after a while, but you can use something called Uptime Robot to keep your repl up! (not sure how to use it tho only heard of people using it)

Profile icon
decomp

bots go offline at night for me and never are up 24/7

Profile icon
RiccardoGiorgi

@decomp at night: what time more or less?