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

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. Create a new repository from this one

3. Set up Heroku

  • 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.)
  • You can change the @app.route stiff in server.py
  • You can also change base.html and index.html without changing the stuff inside {% %} or {}, and you are able to change the css and js files freely
  • Don't change the rest of the files or the name of any file or folder unless you know what you're doing
  • Don't under any circumstances rename the "static" and "templates" folders

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

I forked from his though IDK why it doesnt say

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.4.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

discordpy_replit_heroku-0.4.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file discordpy-replit-heroku-0.4.0.tar.gz.

File metadata

  • Download URL: discordpy-replit-heroku-0.4.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for discordpy-replit-heroku-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5d9ffd67ec744df168b49da525d73e150e92daf50cdfceaf7cfb4bb6c84f5422
MD5 42c6b0d401fe22e15470040abf39238a
BLAKE2b-256 92a291b31c248d89fb86202c5d118520c5234a059de14b49151320e23ec38d0d

See more details on using hashes here.

File details

Details for the file discordpy_replit_heroku-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: discordpy_replit_heroku-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for discordpy_replit_heroku-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7a7f3ad53d7ec16e2c19b37a0cb7a0d6a6f0d7d8dbc579b5ec7616ddfa15ee3
MD5 1e7cdf3d20c9465395c87ad905a12cd9
BLAKE2b-256 3620fa420173305dea4654364d952ae077665995c4afc79bf698e285565174bb

See more details on using hashes here.

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