A feature-rich Discord bot with ticket system, moderation tools, announcements, and clustering capability for high availability.
- Clustering: Multiple bot instances with automatic leader election
- Ticket System: Create and manage support tickets
- Moderation: Kick, ban, and manage members
- Announcements: Send server-wide announcements
- Logging: Comprehensive logging for various events
- Configuration: Flexible per-guild configuration
- Clone this repository
- Install Rust (latest stable version)
- Create
config.tomlandcluster.tomlfiles (see Configuration section) - Set
DISCORD_TOKENenvironment variable - Run with
cargo run
[cluster]
instance_id = "unique-instance-name" # Unique identifier for this instance
priority = 1 # Leadership priority (lower = more likely to be leader)The bot automatically creates this file with default values if it doesn't exist. Example structure:
[guild_id]
logging_channel = 1234567890 # Default logging channel
member_log_channel = 1234567890 # Member join/leave logs
ticket_log_channel = 1234567890 # Ticket activity logs
mod_log_channel = 1234567890 # Moderation action logs
announcement_channel = 1234567890 # Announcement channel
boot_quit_channel = 1234567890 # Bot startup/shutdown notifications
ticket_category = 1234567890 # Category for ticket channels
ticket_roles = [1234567890] # Roles with ticket access
ticket_exempt_role = 1234567890 # Role exempt from seeing ticket messageRunning the /help config command will show all available subcommands for configuration.
help [command]- Shows help menu (leader-only)vote <choice>- Vote for somethinggetvotes [choice]- Show vote counts
ticket [issue]- Create a new support ticketcloseticket [reason]- Close the current ticket (admin-only)
kick <user> [reason]- Kick a user (admin-only)ban <user> [reason] [delete_message_days]- Ban a user (admin-only)announce <message>- Make an announcement (admin-only, leader-only)
config- Show configuration commandsset_log_channel <type> <channel>- Set logging channel- Types: boot, member, ticket, mod, announcement, or default
set_announcement_channel <channel>- Set announcement channelset_ticket_log_channel <channel>- Set ticket logging channelset_member_log_channel <channel>- Set member join/leave logging channellog_channel <channel>- Set default logging channelticket_category <category>- Set ticket categoryadd_ticket_role <role>- Add role to ticket accessremove_ticket_role <role>- Remove role from ticket accessticket_message <text_file>- Set ticket message template (upload .txt file)ticket_exempt_role <role>- Set role exempt from ticket messageremove_ticket_exempt_role- Remove ticket exempt rolelist_ticket_roles- List all ticket access roles
quit- Shutdown all bot instancesquit [instance id]Shutdown specific bot instancewriteconfig- Force save config to disk (owner-only)
The bot supports multiple instances with automatic leader election:
- Instances communicate via a dedicated Discord channel
- Heartbeats are sent every 10 seconds
- Leader timeout is 60 seconds
- Highest priority instance becomes leader (with oldest instance as tiebreaker)
- Only the leader executes certain commands
The bot logs these events to configured channels:
- Bot startup/shutdown
- Member joins/leaves
- Ticket creation/closing
- Moderation actions (kicks/bans)
- Announcements
- Customizable ticket message templates
- Role-based access control
- Exempt roles that don't see the ticket message
- Automatic channel creation with proper permissions
- Comprehensive logging
- Rust 1.70+
- Tokio runtime
- Discord bot token with these intents:
- Guilds
- Guild Members
- Guild Messages
- Message Content
License