- Notifications
You must be signed in to change notification settings - Fork7
An easy to use serenity reaction role bot, easy to configure!
License
Arthurdw/Reaction-Role
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
🔥 The bot has been fully rewritten in Rust! 🔥(check outMigrating)
This is a easy to use Discord bot with human friendly configuration files.
- Emoij Reaction Roles (also works with custom emoji's)
- Experience/Leveling system with leaderboard
- Token configurable from env (also loads .env) or config file
- Reaction logging
- Chat and slash command support (configurable)
- Configurable rich presence
- Configurable verbose logging
Go to theDiscord Developer Portal.Click onNew Application
and give your bot a name.
Then you should be redirected to the application page. Click onBot
in the sidebar.
Great, now we are on the page where we can manage our bot; on this page you canchange the username, avatar and banner of your bot. You can also set your bot tobe private (recommended but not required).
In order for Reaction-Role to run on your bot we need the token, initially notoken will be known, so we need to reset it. This token is very important andshould be kept secret. If you ever think your token has been compromised, or youhave lost it, you can just reset it here.
Copy the token and save it somewhere safe (we will need this for the configuration)
Our last step is to ensure the bot has the correct Discord intents enabled.We can just do this by scrolling down in the bot page and enable all intents.(or the ones that apply) Remember to save your changes.
Setting up the bot is easy, in the config directory you will find*.example.yaml
files. Make sure to copy each of these files to a new filewithout the.example
extension.
./config/config.yaml
- Contains all bot configuration./config/lang.yaml
- Contains all language strings (this is what the botsends for messages)
The bot requires a token to authenticate with Discord.(seeCreating a bot and finding your token)
There are two ways to provide the bot with the token, either through anenvironment variable or through the config file.
If you don't know what an environment variable is, you can just use it in theconfig file and settoken_env_enabled
tofalse
.
token_env_enabled:falsetoken:"XXXYOURBOTTOKENHEREXXX"
If you want to use environment variables, you can set thetoken_env_enabled
totrue and set the key of the environment variable in thetoken_env
field..env
files will also be loaded automatically.
In the config, you will find a key calledreaction_roles
. This key contains alisting of messages that it will watch for reactions.
On each message you can define several emoji's and their role (id) that shouldbe given if someone reacts to it using that emoji.
For custom emoij's use the emoij id.
In your Discord client, enable developer mode(settings -> advanced). Now goto the message that you want to use and right click on the message. You shouldsee a new option calledCopy ID
. This will copy the message id to yourclipboard. Which you can then paste in the config file.
For role id's, you can do the same but on the role in the server settings or ona user profile.
Now that you have your bot token, you can use the provided docker compose fileto easily get your bot up and running.
In the project directory(where thedocker-compose.yml
file is located), runthe following command:
docker compose up
If you have just pulled an updated version of the bot, you might want to rebuildthe image:
docker compose up --build
To run the bot in the background, you can use the-d
flag:
docker compose up -d
This bot is written in Rust, so you will need to have Rust installed on yoursystem. OpenSSL is also required for the bot to work. If you are using theNix package manager, you can load theflake.nix
file.
Once all dependencies are installed, you can run the bot with the following
cargo run --release
BEFORE MIGRATING, MAKE SURE TO TURN OFF THE BOT AND BACKUP YOURdb
FOLDER IFPRESENT!
The only change required is in the config.Make the.py
and.cfg
files to the expected YAML format.All data will keep working.
Rust provides a more stable development environment and is just my preferredlanguage. As an added bonus, it's faster and more efficient than Python.
The YAML format is language independent and is easier to read and write.This change allows for more flexibility in the configuration and for apotentional future where the bot is rewritten in another language.
Pleasecreate an issueor joinour discord and I'll help you out!
If you like this work, you can support me by buying me a coffee!paypal.me/ArthurDeWitte
Special thanks tocombatmedic02
for supporting me in this project ♥
About
An easy to use serenity reaction role bot, easy to configure!