A Discord bot built with Python and discord.py
, designed for handling direct messages, and enabling moderators to reply to users through a dedicated channel.
discord.py
librarypython-dotenv
for environment variable managementjson
for configuration managementgit clone https://github.com/w3nabil/discord-modmail.git
cd discord-modmail
pip install -r requirements.txt
.env.EXAMPLE
to .env
in the project root and add the following:
BOT_TOKEN=your_discord_bot_token
config.json
:
config.json
file in the project root and structure it like this:
{
"server_id": 123456789012345678, // This is your SERVER ID
"mod_channel_id": 123456789012345678, // This is the channel where dms messages will be forwarded
"mod_role_id": 123456789012345678 // Moderator Role, so that they can send messages
}
python bot.py
reply <user_id> <message>
config.json
is missing or has incorrect values, the bot will print an error message and exit.This project is licensed under the MIT License. See LICENSE for details.
For questions, feedback, or collaboration opportunities, feel free to reach out at w3nabil@gmail.com.