This tutorial will walk you through the process of hosting your own bot via Heroku.
Fork this repository
If you don’t yet have a Github account,create one! It’s free and easy.
Clickhereor click the icon below to fork our project.
While you’re at it we would greatly appreciate adding a star to our project to promote RITA in Github for others to benefit too. You can do that by clicking the icon below and then clicking the _Star_** image in the top-right corner of the** repo. *
Heroku is a PaAs (platform as a service). They provide hosting services for free so this will be where your bot will be hosted. You can always run your bot locally or on a personal machine (though the hosting device would constantly need to allocate memory and power to the Bot for it to be online), look atthis pagefor more assistance
Create a new app. It’s name must be unique and composed of all lowercase letters and dashes. Something like yourname-discordbot is fine
Under Deployment Method select Github. Connect to your Github account and search for RitaBot, once it appears click on it to connect your fork.
Scroll down to the manual deploy section, and make sure the master branch is selected. Click deploy branch, and wait for the successfully deployed message.
Go to the Resources tab and look for the addons section. Search ‘Heroku Postgres’, and add ‘Hobby Dev - Free’ version of Heroku Postgres. This will be automatically attached as your bot’s database.
Go to the Settings tab. Click to reveal Config Variables, then add then add the following:
KEY: = DISCORD_TOKEN
Value: = Your discord bot’s token that you copied earlier.
KEY: = NODE_MODULES_CACHE
Value: = false
This is to ensure that when the bot updates it does not use any old Dependencies that Heroku has stored and gets fresh ones from the package.json file
Go to the Overview tab and click configure dynos. Turn off the default web npm start dyno and turn on the worker node src/bot.js dyno. Your bot will now be up and running!
Make sure to do this or your bot shall crash!
Invite your bot to your server and configure it!
Replace the CLIENTID string in the following URL with your own apps client id from Step 2
Visit the resulting URL and add your bot to any server where you have admin privileges.
Redeploy your bot
Go back to Heroku and go to the “Deploy” Section of your Heroku Application. Scroll down to ‘Manual Deploy’ and click deploy for the master branch. Once deployed type in the chat !tr help and then !tr embed on or !tr embed off. Then translate away ;)