AlertBot is a Discord bot for warning players and managing moderation records with Discord slash commands. It stores server warnings in a local JSON file, sends warning notifications by direct message when possible, and lets authorized moderators view or clear a member’s warnings.
-
Install Python 3.9 or newer.
-
Download or clone the project files.
-
Install the dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the project directory. -
Add your Discord bot token to the
.envfile:DISCORD_TOKEN=your_discord_bot_token_here
-
Invite the bot to your Discord server with permissions to use application commands and moderate members.
-
Start the bot:
python bot.py
The bot creates warnings.json automatically when the first warning is saved.
Use the following slash commands in a server:
/warn member reasonissues a warning to a member. The command requires the Moderate Members permission./warnings memberdisplays the member’s saved warnings privately to the moderator. The command requires the Moderate Members permission./clearwarnings memberremoves all saved warnings for a member. The command requires the Manage Server permission.
Warnings include the reason, moderator, and creation time. The bot attempts to notify the warned member by direct message. If direct messages are closed, the warning remains saved and the moderator is informed.
More Discord bot projects by EnderDevelopment: https://github.com/EnderDevelopment