This tutorial will tell you how to host a Discord.js Bot on the online and free web hosting service Heroku.
First go to Heroku Dashboard (click here) and now create an account with your email and a unique password.
Now, create an app in your dashboard (click on Create New App top right corner). Name your app, and click Create App, Now we are done here.
Also create an Readme.md with your description and an empty file named index.js
Now open your Heroku app and click on Deploy Tab and now click Github, it will ask for access, grant it, select your repo and if you want you can Enable Automatic Deploys(all your code changed in github will go in bot directly)
Now go on Resources Tab click on Configure Dynos and adjust it like this,
Now in settings, click on Revel Config Vars, now type TOKEN in your key and your bot’s token in the value.
Now click on Run Console(in the menu on top right corner) and type node index.js type this everytime your bot goes offline for some reason, its starts the process, once started it will not stop until something went wrong.
So your bot shouldn’t be online yet, it will become online after first step in creating codes.