Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

mat-1/forum-sweats

Repository files navigation

Discord bot for the Forum Sweats Discord

Self-hosting

Adding the bot

  1. Make an empty Discord server.
  2. Make a new application in https://discord.com/developers/applications (name it Forum Sweats or something).
  3. Go to the Bot tab and click Add Bot, and confirm.
  4. Go to the OAuth2 tab, under scopes select "bot", and under bot permissions select "administrator".
  5. Go to the url that shows up (should start with https://discord.com/api/oauth2/authorize?client_id=) and add the bot to your server.

Installing & configs

  1. Install Python 3.8+ from the Windows store (remove any existing Python installations).
  2. Download the source from https://github.com/mat-1/forum-sweats/archive/master.zip and unzip it anywhere.
  3. Install Git from https://git-scm.com/download/win
  4. Install Poetry by running pip install poetry or running (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python - in Powershell
  5. Run poetry install to install the dependencies.
  6. Enable Discord developer mode in settings -> advanced -> developer mode if it's not already enabled.
  7. Right click your server in the sidebar and click "copy id".
  8. In config/bot.json, replace 717904501692170260 with your own server id that you just copied.
  9. In config/channels.json, replace the channel ids there with your own (you can right click -> copy id channels in your own server to get the ids).
  10. In config/roles.json, replace the role ids with your own.
  11. In the root directory with main.py and the forumsweats folder, create a file called ".env" (just .env, nothing before or after).
  12. Go back to the Discord bot developer page, and in the Bot tab copy the token.
  13. In the .env file put token=the token you just copied here.

Setting up database

  1. Go to https://mongodb.com.
  2. Sign up to MongoDB Atlas.
  3. In the "Let’s get your account set up" page, just click skip at the bottom.
  4. In "Choose a path. Adjust anytime.", select the free "create a cluster" button.
  5. Maybe change the location and stuff if you want, then at the bottom click Create Cluster.
  6. Click the "Network Access" tab at the left.
  7. Click the Add IP Address button.
  8. Select the gray "Allow access from anywhere" button, then confirm.
  9. Go back to the "clusters" tab at the left (you might have to wait for it to finish loading).
  10. Click the gray "connect" button in the cluster.
  11. Set the username as "admin", autogenerate a password, and save it somewhere, then click the green Create Database User button.
  12. Click the green Choose a connection method button.
  13. Select "connect your application".
  14. Copy the long uri that shows up (should start with mongodb+srv://).
  15. Paste it somewhere and replace <password> with the password you saved.
  16. Replace <dbname> with discord.
  17. Back in the .env file, put dburi=mongodb+srv://your mongodb uri here in a new line after the token one.

Running the bot

  1. In the terminal run poetry run python main.py, and cross your fingers.

Releases

No releases published

Packages

No packages published

Languages