This project is a Server Discord bot that handles interactions, messages, reactions and Slash commands. It is built using Python and the Discord.py library.
To use this bot, you need to do the following:
- Clone this repository to your local machine.
- Modify the
config.ini
file with your settings. - Install the required Python packages by running
pip install -r requirements.txt.
- Run the
main.py
file to start the bot.
The project is structured as follows:
.
├── .github
│ └── workflows
│ └── phraseActions.yml
├── cogs
│ ├── dev.py
│ ├── interaction.py
│ ├── reaction.py
│ ├── slash.py
│ └── verification.py
├── utils
│ ├── email_template.txt
│ └── helper.py
├── .gitignore
├── LICENSE
├── README.md
├── bot.py
├── config.py
├── main.py
└── requirements.txt
It is a convention to keep all GitHub-related stuff inside the folder used. It houses workflows, issue templates, pull request templates, funding information, codeowners, SECURITY.md, and other files specific to that project. All folders starting from .
are hidden by default in most Linux desktop environments' file managers.
All GitHub workflows reside here Refer to these pages from GitHub docs:
Contains the workflows which act as a bot listening for slash commands.
Contains the Python files that handle the bot's functionalities.
Contains the MIT License agreement for this project.
This file which you are reading right now.
All Non-Sensitive global config variables are set here for the bot. Sensitive variables are to be placed in a user-generated .env
. File as follows
DISCORD_BOT_TOKEN="PASTE BOT TOKEN HERE"
SIB_API_KEY="PASTE API KEY HERE"
SIB_SENDER_EMAIL="PLACE EMAIL HERE"
FERNET="PLACE FERNET KEY HERE"
Contains the template for the email that the bot sends.
The main Python file starts the bot and loads the different cogs. It reads environment variables to start the bot by importing IITMBot from bot.py and sets it up along with the context manager for logging.
It is the list of required Python packages for the project.
Contains commands for development purposes. All these commands require the is_owner
decorator to limit their use to just the bot owner.
!eval
- Useful to run code on the fly to test stuff. (Dangerous when abused)!kill
- Kill the bot through discord!sync_apps
- Synchronize slash commands to the bot!clear_apps
- Remove all slash commands from the bot
Contains code for verification of new joiners.
To run the bot, execute the following command:
python main.py
This command will start the bot and be ready to receive messages and interactions from Discord users.
If you have any questions or suggestions, please feel free to contact the repo owner at mohit.sinsniwal.dev@gmail.com
Alternatively, you can contact other developers via Discord (https://discord.gg/5j9cEyMH). Search for people with the developer
role.