A Discord moderation and support-ticket bot built with Python and discord.py.
- Slash commands only (
/commands) - Temporary moderation actions:
- Temporary ban with auto-unban
- Temporary mute (timeout) with auto-unmute
- Manual moderation actions:
- Unban, unmute, kick, purge
- Utility commands:
- Help, ping, avatar, user info, server info
- Configurable ticket system:
- Ticket panel with button
- Private ticket channels
- Support role access
- Close-ticket button with modal reason input
- Ticket logging channel (optional)
- SQLite persistence:
- Temporary actions survive bot restarts
- Ticket settings and ticket records are stored
- Python 3.8+
discord.py2.4+
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txtCreate token.txt in the project root and put your bot token inside (single line):
YOUR_BOT_TOKEN_HEREtoken.txt is already ignored by git in .gitignore.
Double-click start.bat.
python bot.pyInvite the bot with these scopes:
botapplications.commands
Recommended bot permissions:
View ChannelsSend MessagesRead Message HistoryManage Channels(tickets)Manage Messages(purge)Kick MembersBan MembersModerate Members
Make sure the bot role is above members it needs to moderate.
/hello/help/ping/avatar [user]/userinfo [user]/serverinfo
/ban <user> <d:h:m:s> <reason>/mute <user> <d:h:m:s> <reason>/unban <user_id> <reason>/unmute <user> <reason>/kick <user> <reason>/purge <amount> [user]
Duration format: d:h:m:s
Example: 0:1:30:0 = 1 hour 30 minutes
/ticket open [subject]/ticket close [reason]/ticket info
/ticketconfig setup <category> <support_role> [max_open_tickets] [ticket_prefix] [log_channel]/ticketconfig panel [channel]/ticketconfig show
- Run
/ticketconfig setupand select:- category for ticket channels
- support role
- optional log channel
- Run
/ticketconfig panelin the channel where users should open tickets. - Users click Open Ticket or run
/ticket open. - Moderators/support close with:
- Close Ticket button (opens modal for close reason), or
/ticket close <reason>
The bot stores persistent data in:
bot_data.sqlite3
This file is ignored by git in .gitignore.
- Global slash command sync can take a short time after restart.
- If the bot restarts, scheduled temporary moderation actions are restored from SQLite.