cover-img

Host a Discord Bot online 24/7 for FREE!

4 March, 2021

20

20

2

Contributors

Today I'll explain the 100% working method to host a Discord bot online 24/7 for free.
First we have to upload our bot in repl.it, then we'll add a bg task in the bot and then we'll setup the uptime robot in a special way.

1. uploading your project on repl.it

Create a new repl and select the language.
img

Upload your project simply by dragging & dropping it from your PC or by importing it from github… here is an example:
img

Now we have to add a background task in the bot, have to keep it alive because repl.it auto sleeps after few minutes.

Now Im goin to tell you adding background tasks in two languages that are discord.js and discord.py

2. Adding a bg task and keeping the bot alive.

(1) Keeping the bot alive & Adding BG tasks in a discord js (v11) bot :

To keep our bot alive we have to add the following code on the head of our js file.
img

As a bg task we will be adding an auto changing bot status feature in our bot.
img

here is the sample code :

2. Keeping the bot alive & Adding BG tasks in a discord.Py bot :

After uploading your project in repl.it don't forget to install the python packages. by goin to packages option on the left side and searching python.

To keep our bot alive we have to add the following code on the head of our py file.

img

Adding a background task :
img

here is the sample code :

3. Setup the Uptime Robot :

First create an account on uptime robot for free.
img

After creating an account, go to the dashboard and click on Add new monitor :
img

select monitor type Http(s) :
img

then go to to your project on repl.it and copy the url from the top of the console and paste it in url section of the monitor:
img

now set the monitoring interval to every 5 mins (so that it will ping the bot every 5 mins) and click on create monitor twice :
img

That's it…Now go to your project on repl.it and hit the Run button :
img
So this was the tutorial on :
This method worked for me and my bot is also working fine :D
Hope you guys liked it and You're bot is now online….peace :)

discord

discord js

discord bots

host discord bot for free

host a discord bot online 24/7 for free

20

20

2

discord

discord js

discord bots

host discord bot for free

host a discord bot online 24/7 for free

Skidee
I like coding, making beats and videos.

More Articles