TicketBot requires Python 3.8+ and a Discord Bot Token. An OpenAI API Key is required for the AI functionality. Optional RustAdmin and RCON connections for enhanced capabilities.
pip install -r requirements.txt
The bot's configuration is managed through a central configuration file. Create a .env
file with the following settings:
DISCORD_TOKEN="Your Discord Bot Token"
OPENAI_API_KEY="Your OpenAI API Key"
OPENAI_MODEL="The OpenAI model to use (default: gpt-4o-mini)"
TIMEZONE="Server timezone (e.g., America/Santiago)"
LOG_LEVEL="Logging level (e.g., INFO, DEBUG)"
TICKET_CATEGORY_ID="Discord category ID where tickets will be created"
SUPPORT_ROLE_ID="Discord role ID for support staff"
ADMIN_ROLE_ID="Discord role ID for administrators"
TICKET_LOG_CHANNEL_ID="Discord channel ID for logging ticket activity"
SUPPORT_CHANNEL_ID="Discord channel ID for the support interface"
MAX_TICKET_IDLE_TIME="Maximum idle time for tickets before notification (in seconds)"
Option | Description |
---|---|
DISCORD_TOKEN | Your Discord Bot Token |
OPENAI_API_KEY | Your OpenAI API Key |
OPENAI_MODEL | The OpenAI model to use (default: gpt-4o-mini) |
TIMEZONE | Server timezone (e.g., America/Santiago) |
LOG_LEVEL | Logging level (e.g., INFO, DEBUG) |
TICKET_CATEGORY_ID | Discord category ID where tickets will be created |
SUPPORT_ROLE_ID | Discord role ID for support staff |
ADMIN_ROLE_ID | Discord role ID for administrators |
TICKET_LOG_CHANNEL_ID | Discord channel ID for logging ticket activity |
SUPPORT_CHANNEL_ID | Discord channel ID for the support interface |
MAX_TICKET_IDLE_TIME | Maximum idle time for tickets before notification (in seconds) |
The System Prompt file defines the bot's personality, capabilities, and knowledge. It provides context for the AI to understand your game servers, rules, and common issues.
You are a helpful support assistant for GameServer, a Rust gaming community with multiple servers. Your task is to help players with their issues, provide information about server rules, and collect necessary information for staff.
File location: prompts/system_prompt.txt
The Keywords file helps the bot categorize and respond appropriately to different types of player queries. Each category contains keywords, aliases, and context prompts that are injected when those keywords are detected in user messages.
{
"vip_issues": {
"keywords": ["vip","subscription","perk","kit","donation","donor","benefit","privilege"],
"context_prompt": "The user is asking about VIP features or having issues with VIP perks. Ask for their Steam ID and which server they are playing on. Check if they have an active VIP subscription. For kit-related issues, verify if the server is modded (kits available) or vanilla."
},
"player_reports": {
"keywords": ["report","cheater","hacker","cheating","aimbot","esp","wall hack","flying"],
"context_prompt": "The user is reporting a player for rule violations or cheating. Collect the following information: Steam ID of reported player, server name, time of incident, and description of suspicious behavior. Ask if they have video evidence or screenshots."
},
"team_size": {
"keywords": ["team size","zerg","alliance","teaming","too many players","group size"],
"context_prompt": "The user is reporting a team size violation. Remind them of server-specific limits: Solo/Duo server (2 max), Quad server (4 max), or 10x server (8 max). Collect location information, player names/IDs, and any evidence they have. Explain the difference between temporary cooperation and formal teaming."
},
"ban_appeals": {
"keywords": ["appeal","banned","false ban","unban","mistake","wrongfully","ban appeal"],
"context_prompt": "The user is appealing a ban. Collect their Steam ID, the server they were banned from, when the ban occurred, and their explanation of why they believe the ban should be lifted. Inform them that all bans are thoroughly reviewed with evidence before being issued."
}
}
Category | Description | Context Injection |
---|---|---|
Vip Issues | Keywords related to VIP subscriptions, benefits, and perks |
The user is asking about VIP features or having issues with VIP perks. Ask for their Steam ID and wh...
|
Player Reports | Keywords for reporting cheaters, hackers, and rule breakers |
The user is reporting a player for rule violations or cheating. Collect the following information: S...
|
Team Size | Keywords for team size violations and alliances |
The user is reporting a team size violation. Remind them of server-specific limits: Solo/Duo server ...
|
Ban Appeals | Keywords for players attempting to appeal a ban |
The user is appealing a ban. Collect their Steam ID, the server they were banned from, when the ban ...
|
File location: prompts/keywords.json
(JSON format)
When the bot detects keywords in a user's message, it injects the corresponding context prompt into the AI's system message. This helps the bot provide more specific and relevant responses without requiring the user to provide all necessary details upfront.
You can customize both the keyword lists and context prompts to better match your server's specific terminology and support needs.
This bot includes specialized context handlers for different types of common user issues:
Extracts Steam ID and server information, determines if the server is modded (kits available) or vanilla, provides specific guidance based on server type, and explains kit commands and troubleshooting steps
Collects Steam ID of reported player, gathers server information and report reason, integrates with RustAdmin to retrieve player statistics, analyzes player behavior for potential cheating, and guides users on providing evidence
Identifies server and team size mentioned, explains server-specific team size limits, provides guidance on alliance rules, and helps users report team size violations
Processes ban appeal requests, collects necessary information like Steam ID and server, and provides a structured process for appealing bans
This bot supports editable categories for organizing user issues, like:
Category | Description | Icon |
---|---|---|
General Support | General questions or issues about the server | ❓ |
Report Player | Report players breaking rules | ⚠️ |
VIP Support | Questions about VIP or issues with VIP perks | ⭐ |
Ban Appeal | Appeal a ban from one of the servers | 🔨 |
Each ticket category creates a dedicated private channel with specialized forms to collect the appropriate information. Users can interact with the AI assistant to get help with their specific issues.
For optimal performance, we recommend hosting your TicketBot on our specialized Discord bot hosting platform. Starting at just $1.99/month, our Python hosting plans provide the perfect environment for running your bot with 24/7 uptime and easy management through the Pterodactyl panel.
View Hosting PlansThis bot is designed specifically for Discord integration with Rust game servers and communities.
For support with bot implementation or customization, please contact us.