Skip to main content

Hosting your repl based discord.py bot on Heroku to keep it running INDEFINETLY

Project description

Hosting your repl based discord.py bot on Heroku to keep it running INDEFINETLY

Join Discord Run on Repl.it

Prerequisites

You must have an account for Discord, GitHub , Heroku, and Repl.it (you probably have an account already).

1. Create a bot and get its token

  • Create an application in the developer portal here
  • Open up your new application and click 'Add Bot' under the Bot settings to create your bot.
  • After creating the bot, click the 'Copy' button under the title Token. Take note of your token as you will need it later.

2. Clone the GitHub repository and set it up to work with Heroku

  • Clone my Github repository into a repl here. This contains all the code you need to host your bot on Heroku. You can also view it here
  • Link your repl to a GitHub repository
  • Create an application for Heroku here.
  • Under 'Deploy', do the following:
    • Deployment Method => Connect your GitHub
    • App connected to GitHub => Search for the forked repository
    • Automatic Deploy => Enable Automatic Deploy (to redeploy after every commit)
  • Under 'Settings', click on 'Reveal Config Vars' and enter the following:
    • KEY => DISCORD_TOKEN
    • VALUE => (Enter the bot token that you copied from the developer portal)
    • Click the 'Add' button after entering all of this information.
  • Under 'Resources', do the following:
    • Click on the 'Pencil' icon.
    • Switch the worker from off to on.
    • Click 'Confirm' to finalize the decision.
    • NOTE: You are given 550 free Dyno hours, which will not last the entire month. However, if you provide a credit card to verify your identity, you are given an additional 450 hours, which will allow your bot to run indefinitely. You will not be charged for this.

What's next?

  • Now you can tweak the main.py file as you please! just don't mess with the first 5 or last 2 lines (you can change the prefix in line 4 though.)

Original code belongs to audieni. I just made it more suitable for repl.it bot creators. Visit his repository here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discordpy-replit-heroku-0.1.3.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

discordpy_replit_heroku-0.1.3-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page