Categories > Coding > Javascript >

[TUTORIAL] How to host a JavaScript Discord Bot using UptimeRobot

Posts: 215

Threads: 39

Joined: Feb, 2021

Reputation: 9

Posted

[DISCLAIMER]

There are definitely WAY better tutorials out there, 
but this is just a basic tutorial for noobs who
are just starting out with bot development.


How to host a JavaScript Discord Bot using UptimeRobot
A tutorial by falseopx


For this tutorial, I'm using replit.com, a browser based IDE. If you would like a tutorial
on how to make a basic bot in replit, I will make one in the future.

Now to start, you need to install Express, you can do this by going into your console, (or in my case, the Shell tab) and type:

npm install express

And wait for the installation to finish, once the installation has finished, go to your index.js file,
go to the top of your file and then type:

const express = require('express')

This will allow you to use the express module to make an express webserver.
Now it is time to create our webserver, and make sure it works, to do this, simply type:

const wserver = express();
const port = 3000;
wserver.get('/', (r1, r2) => r2.send('webserver online'));

wserver.listen(port, () => console.log(`webserver online`));

Now, press the Run button, you should get a result such as:
https://cdn.discordapp.com/attachments/830286286883389464/831281062763692032/unknown.png


Now that we have a webserver up and running, we can get started with uptimerobot.com.


Once you are on uptimerobot.com, Click the 'Register for FREE' button., There should be instructions on the Sign Up page. Follow the instructions and you should be on this screen: 
https://cdn.discordapp.com/attachments/830286286883389464/831281198738964561/KZXIy04EEoGfQOAbWkAecLRWrWYAAAAASUVORK5CYII.png


Once you are on this screen, click on the 'Add New Monitor' button.
https://cdn.discordapp.com/attachments/830286286883389464/831281453659586570/7D8rSkR4qx3zkodCIR0CSpfoz9aEMQw97QrCFoQ9dCIJGTRo5CPwv7mWaSXwmYmEAAAAASUVORK5CYII.png


Click on 'Please Select', and select HTTPS
https://cdn.discordapp.com/attachments/830286286883389464/831281677322027039/3hRI1RVTU7NzM2zGAGBgUFHjhwRLrEqRwQmDASAABAAAkAACFRIAv8Pk6866YiDr6wAAAAASUVORK5CYII.png


Now go back to replit, now go to the area where you have the webserver page, copy the link
https://cdn.discordapp.com/attachments/829902520545312828/831283083986206790/unknown.png
And paste it into the 'URL or IP' Box.
Now you dont have anything else to do, but click 'create monitor', you can also check the "emergency contacts" toggle if you want to be notified when your monitor goes down (which is rare)


And then you can press the 'Run' Button on your repl, and Volia! You have a bot on 24/7 hosting! I will post a new thread on how to make a basic discord bot on replit.com soon, dw.
If any JS bot experts spy that i have said or done something wrong, please tell me by discord at falseopx#2012.
thanks!

  • 0

MINISHXP

[REDACTED]

Posts: 976

Threads: 3

Joined: Jan, 2021

Reputation: 9

Replied

this is a really nice tutorial, (im tying to make a bot rn for my server).

tbh tho i would use python

  • 0

Bones

deez nuts

Posts: 353

Threads: 10

Joined: Mar, 2021

Reputation: 11

Replied

@MINISHXP Stay with Node.JS. The Discord.JS Libary has a lot of functions and is easy to use

  • 0

Who's Deez?

MINISHXP

[REDACTED]

Posts: 976

Threads: 3

Joined: Jan, 2021

Reputation: 9

Replied

@66746i guess im learning javascript now :cri:

  • 0

Zera

Casual Femboy Agent

vip

Posts: 1556

Threads: 39

Joined: Mar, 2020

Reputation: 42

Replied

@Bones

 

If you know about the discord.js library, provide me a couple functions found in the discord.js library

  • 0

https://cdn.discordapp.com/attachments/995469995742068832/1073019970012848228/Untitled39_20220604185345.png

Bones

deez nuts

Posts: 353

Threads: 10

Joined: Mar, 2021

Reputation: 11

Replied

@Zera Pretty much didn't use it for the last 6 months because i quit Discord Bot Development, and used the libary for smaller Projects. Anyways here are a few functions i still remember:

premiumTier(), premiumSubscribtionCount(), on(), token(), reply(), send(), forEach(), member()

 

I don't remember a lot, probably going to start another Bot Project soon

  • 0

Who's Deez?

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )