new file: .gitignore new file: Dockerfile new file: README.md new file: bot.py new file: requirements.txt
Discord Ticket Management Bot
A Discord bot for creating and managing project update tickets with integration to devanturas.net projects.
Features
- ✅ Create tickets with slash commands
- 📋 Track project updates from devanturas.net
- 🔄 Update ticket status (Pending, In Progress, Completed, Cancelled)
- 📦 Automatic archiving of completed tickets
- 🎫 List and view all active tickets
- 📊 Beautiful embed messages with ticket information
Setup Instructions
1. Create a Discord Bot
- Go to Discord Developer Portal
- Click "New Application" and give it a name
- Go to the "Bot" section
- Click "Add Bot"
- Under "Privileged Gateway Intents", enable:
- MESSAGE CONTENT INTENT
- SERVER MEMBERS INTENT
- Click "Reset Token" and copy your bot token
2. Install Dependencies
pip install -r requirements.txt
3. Configure the Bot
-
Copy
.env.exampleto.env:copy .env.example .env -
Edit
.envand add your bot token:DISCORD_TOKEN=your_bot_token_here
4. Invite the Bot to Your Server
- In the Discord Developer Portal, go to "OAuth2" > "URL Generator"
- Select scopes:
botapplications.commands
- Select bot permissions:
- Send Messages
- Embed Links
- Read Message History
- Manage Messages
- Copy the generated URL and open it in your browser
- Select your server and authorize
5. Run the Bot
python bot.py
6. Configure Channels
In Discord, use the /setup command to configure the channels:
/setup active_channel:#active-tickets archive_channel:#archived-tickets
Commands
/ticket - Create a New Ticket
Create a new project update ticket.
Parameters:
message_id: Discord message ID to referenceproject_name: Project name from devanturas.net/versionstitle: Brief description of the update
Example:
/ticket message_id:123456789 project_name:MyProject title:Version 2.0 Update
/status - Update Ticket Status
Update the status of an existing ticket.
Parameters:
ticket_id: The ticket ID (e.g., TICKET-0001)new_status: Choose from:- ⏳ Pending
- 🔄 In Progress
- ✅ Completed
- ❌ Cancelled
Example:
/status ticket_id:TICKET-0001 new_status:In Progress
Note: When a ticket is marked as "Completed", it will automatically be moved to the archive channel.
/list - View Active Tickets
Lists all currently active (non-archived) tickets.
Example:
/list
/info - Get Ticket Details
Get detailed information about a specific ticket.
Parameters:
ticket_id: The ticket ID to view
Example:
/info ticket_id:TICKET-0001
/setup - Configure Bot Channels
Configure the active and archive channels for tickets (Admin only).
Parameters:
active_channel: Channel for active ticketsarchive_channel: Channel for completed tickets
Example:
/setup active_channel:#active-tickets archive_channel:#archived-tickets
Ticket Workflow
- Create: Use
/ticketto create a new ticket in the active channel - Update: Use
/statusto update the ticket status as you work - Complete: Mark ticket as "Completed" to automatically archive it
- Archive: Completed tickets are moved to the archive channel
Project Integration
The bot integrates with devanturas.net:
- All projects: https://devanturas.net/versions
- Specific project: https://devanturas.net/projects/{project_name}
Each ticket embed includes direct links to the project pages.
Data Storage
Currently, tickets are stored in memory. For production use, consider implementing:
- Database storage (SQLite, PostgreSQL, etc.)
- Persistent ticket data between restarts
- Backup and recovery mechanisms
Docker Support
Build and run with Docker:
# Build the image
docker build -t discord-ticket-bot .
# Run the container
docker run -d --name ticket-bot --env-file .env discord-ticket-bot
Troubleshooting
Bot doesn't respond to commands
- Make sure the bot is online
- Check that you've enabled the correct intents in the Developer Portal
- Verify the bot has permissions in your server
Commands don't appear
- Wait a few minutes for commands to sync
- Try kicking and re-inviting the bot
- Check the bot logs for sync errors
Tickets aren't archiving
- Verify you've run
/setupto configure channels - Check that the bot has permissions in both channels
License
MIT License - feel free to modify and use for your projects!
Author
Created for SimolZimol