Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

This repository is the non official discord repository rewritten for python, for a linked role bot.

License

Notifications You must be signed in to change notification settings

jadnast/discord-linked-roles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

❇️ This version is running successfully. If you need help, please contact us :)

Linked Roles

This repository is the non official discord repository rewritten for python, for a linked role bot.

Project structure

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

Running app locally

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.

Setup project

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

Get app credentials

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

Running your app

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

About

This repository is the non official discord repository rewritten for python, for a linked role bot.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages