❇️ This version is running successfully. If you need help, please contact us :)
This repository is the non official discord repository rewritten for python, for a linked role bot.
All of the files for the project are on the left-hand side. Here's a quick glimpse at the structure:
├── images -> Images for documentation
├── modules
│ ├── discord.py -> Discord specific auth & API wrapper
│ ├── storage.py -> Provider for storing OAuth2 tokens
├── config.py -> Parsing of local configuration
├── main.py -> Main entry point for the application
├── register.py -> Tool to register the metadata schema
├── requirements.txt -> All libraries you need to install
└── README.md
Before you start, you'll need to create a Discord app with the bot
scope
Configuring the app is covered in detail in the tutorial.
First clone the project:
git clone https://github.com/jadnast/discord-linked-roles.git
Then navigate to its directory and install dependencies:
cd discord-linked-roles
pip install -r requirements.txt
Fetch the credentials from your app's settings and add them to a config.py
file. You'll need your bot token (DISCORD_TOKEN
), client ID (DISCORD_CLIENT_ID
), client secret (DISCORD_CLIENT_SECRET
). You'll also need a redirect URI (DISCORD_REDIRECT_URI
) and a randomly generated UUID (COOKIE_SECRET
), which are both explained below:
DISCORD_CLIENT_ID: <your OAuth2 client Id>
DISCORD_CLIENT_SECRET: <your OAuth2 client secret>
DISCORD_TOKEN: <your bot token>
DISCORD_REDIRECT_URI: https://<your-project-url>/discord-oauth-callback
COOKIE_SECRET: <random generated UUID> - already created
For the UUID (COOKIE_SECRET
), we use:
uuid.uuid4().hex
After your credentials are added, you can run your app:
python main.py
And, just once, you need to register you connection metadata schema. In a new window, run:
python register.py