BooK-TrackeR
A discord bot to track pdfs your book.
Steps for hosting a bot for your own server using Heroku.
-
To set it on heroku, you'll need an acoount in heroku. Make an account and download the CLI from here
-
Open up terminal or Command Prompt and enter the command
heroku login
. It will take you to the browser to login. -
Now clone this repository using the command
git clone https://github.com/As-Sami/book-trackerr.git
-
After cloning move to the book-trackerr folder using this command
cd book-trackerr
-
Now enter
heroku create
command in the terminal and hit enter. It will create a new app for you. Remember the name. -
Now you need to add the Python buildpack to install essential packages.
-
To add Python buildpack type the following command
heroku buildpacks:add heroku/python
. -
Now go to the personal dashboard page of heroku on your browser.
-
Next click on the app you created in step 6.
-
Now, go to resources and click on Find more add-ons and find Heroku Postgres.
-
Click to install the database on the Hobby Dev plan and set the app to the one that hosts the bot.
-
Go to settings tab and you will see a section called Config Vars. Click on the reveal config vars button.
-
Now you need to create a config var called BOT_TOKEN and paste your bot token created using discord and hit add. You need to add another variable and that is the id for super users (read the description below to know about super user). Create a config val named SUPER_USERS and put ids with a comma at middle. (Example:
12345
or12345,6789,343534
). -
Make sure that the name of the config var that contains the database url is named DATABASE_URL.
-
Now the setup is almost done. Type the following command
git push heroku master -f
and press enter. -
It will take few minutes to build and deploy.
-
After successful build open the heroku app in your browser. The same step as 8.
-
Go to Resources tab and turn on the worker. You are not charged for doing this its completely free.
-
Enjoy..................................................
Config Vars
BOT_TOKEN : the Discord Bot Token for your bot.
SUPER_USERS : ids of super users. Super users are those people who can use the add and delete command. To get their id, go to the setting of your discord and then go to Advance and turn on developer mode. Now the person you want to make super user, right click on his profile and you will see a copy COPY ID
. Just click on the copy COPY ID
button and you will get the id.