NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Free Hosting using Heroku
I hope you all are doing fine, in this blog we are going to discuss about hosting and how to host our own discord bot, which we made in my previous blog .

We are going to use Heroku to host our bot.

What do I mean when I say 'HOST' a discord bot?

So basically you cant run the program which you made for 24x7 and 365 days, so we need a server to do that.

The hosting platform has a lot of servers which will serve our discord bot for 24x7 and 365 days, so you and your friends can anytime use it anytime!!

Let's host it now 🤖 :

1. Sign-up or Log-in to Heroku :

1. Click on the new button on the top-right corner.
2. Click on Create New App

1. Click on Create App

1. Make sure source code does not contain your discord bot TOKEN or any other API key.

1. Click on the Connect to GitHub button.
2. Then select the repository which you created.
3. Once the repo is connected, just press on Enable Automatic Deploys, which will help us to deploy the new version of our bot automatically whenever the repo is updated.
4. Refer to this image 👇🏻

Then go the settings tab:

1. Click on Reveal Config Vars
2. 👇🏻
3. Inside the config vars enter your key and value pair of your API KEY and Discord Bot's Token. 👇🏻

Add a BuildPack:

1. BuildPack are scripts that are run when your bot will be deployed. They are used to install dependencies for your bot and configure your environment.
2. Click on add BuildPack 👇🏻
3. Then click on Node.JS 👇🏻 as our bot is made using JS and Node Modules.

After these steps, go to the home directory of your project and make a new File with the name of Procfile

1. The Procfile should contain worker node / in this case, it will be worker node src/bot.js .
Procfile will help the Heroku's server to run our bot.

Now push the new change to the repository.

Go to the deploy tab:

1. Now click on the Deploy Branch button.
2. You will see a green check mark which will ensure you that there are no errors while deploying 👇🏻.

Go to the resource tab:

1. Refresh the page once.
2. You can see 2 Dynos 👇🏻
3. Click on the pen icon and switch off the Web and Switch on the Worker.

Click on more and then click on view logs.

That's it you have successfully hosted your discord bot, and now you and your friends can use the bot anytime you want 🎉!!

Thank you so much for reading the whole blog and if you liked it, do share it with your developer friends 💻!!

In case you want to learn how to make a discord bot(my previous bog's topic)and how to host it on Heroku, do check out my talk 🎉!

Make a Discord Bot using Discord.js and host it online on Heroku

Discussion (4)

- Joined
Jun 25, 2021

Very Informative 👍👍

Thanks bro

- Location
Hong Kong

- Work
Web Developer at Hong Kong

- Joined
Sep 28, 2019

Heroku is really easy to register, setup and get the results. It is extremely easy that I don't even need a user manual. It can automatically deploy my server when commits are pushed to my Git repo. discord servers

Yup Heroku makes deployment so easy!!

Read More: https://discord-servers.co/
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.