Discord bot for the Forum Sweats Discord
- Make an empty Discord server.
- Make a new application in https://discord.com/developers/applications (name it Forum Sweats or something).
- Go to the Bot tab and click Add Bot, and confirm.
- Go to the OAuth2 tab, under scopes select "bot", and under bot permissions select "administrator".
- 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.
- Install Python 3.8+ from the Windows store (remove any existing Python installations).
- Download the source from https://github.com/mat-1/forum-sweats/archive/master.zip and unzip it anywhere.
- Install Git from https://git-scm.com/download/win
- 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 - Run
poetry install
to install the dependencies. - Enable Discord developer mode in settings -> advanced -> developer mode if it's not already enabled.
- Right click your server in the sidebar and click "copy id".
- In config/bot.json, replace 717904501692170260 with your own server id that you just copied.
- 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).
- In config/roles.json, replace the role ids with your own.
- In the root directory with
main.py
and theforumsweats
folder, create a file called ".env" (just .env, nothing before or after). - Go back to the Discord bot developer page, and in the Bot tab copy the token.
- In the .env file put token=the token you just copied here.
- Go to https://mongodb.com.
- Sign up to MongoDB Atlas.
- In the "Let’s get your account set up" page, just click skip at the bottom.
- In "Choose a path. Adjust anytime.", select the free "create a cluster" button.
- Maybe change the location and stuff if you want, then at the bottom click Create Cluster.
- Click the "Network Access" tab at the left.
- Click the Add IP Address button.
- Select the gray "Allow access from anywhere" button, then confirm.
- Go back to the "clusters" tab at the left (you might have to wait for it to finish loading).
- Click the gray "connect" button in the cluster.
- Set the username as "admin", autogenerate a password, and save it somewhere, then click the green Create Database User button.
- Click the green Choose a connection method button.
- Select "connect your application".
- Copy the long uri that shows up (should start with mongodb+srv://).
- Paste it somewhere and replace <password> with the password you saved.
- Replace <dbname> with discord.
- Back in the .env file, put dburi=mongodb+srv://your mongodb uri here in a new line after the token one.
- In the terminal run
poetry run python main.py
, and cross your fingers.