A multifunction Discord bot developed in Rust using the Poise framework and Serenity library.
-
Interactive Creation:
- Triggered by Direct Message (DM) to the bot.
- Language selection (French/English).
- Category selection (Partnership, Recruitment, Support, Other).
- Automatic creation of a private channel on the server.
- Automatically configured permissions (Staff + User + Bot).
-
Management:
/rep <message>: Allows staff to reply to the user anonymously ("Support: Message")./close: Closes the ticket, deletes the channel, sends a full transcript (.txt file) to logs, and notifies the user./rename <name>: Allows renaming the ticket channel.
-
Automation:
- Automatic reminder via DM after 24h of inactivity.
- Automatic closure after 48h of inactivity.
-
Ticket Moderation:
/blticket @user <reason>: Blacklists a user (prevents them from opening tickets)./unblticket @user: Removes a user from the blacklist.- Automatic verification on every direct message.
-
Automatic Creation:
- Joining a "Hub" channel (configured in
config.toml) creates a temporary voice channel. - Channel name:
🔉〢Username. - The creator becomes the owner.
- Joining a "Hub" channel (configured in
-
Management:
- The owner has moderation permissions on their channel (Mute, Deafen, Move, Manage Channels).
- Automatic deletion of the channel when empty.
- Automatic ownership transfer if the owner leaves (but others remain).
-
Logs:
- Logs for creation, deletion, and ownership transfer in a dedicated channel.
- Detection and logging if a channel is manually deleted.
-
Creation & Interface:
- Command
/giveaway(Staff only) opens an ephemeral control panel. - Interactive Modal to configure: Title, Description, Duration (e.g.,
1j,1h,10s), Reward, Winner Count. - Public embed creation with a "Participate" button.
- Command
-
Participation & Automation:
- Users join/leave by clicking the button (no reactions).
- Real-time participant counter on the embed.
- Auto-End: Automatically picks random winner(s) when time expires.
- Smart Duration: Supports short durations (seconds) and long durations (days) with high precision.
-
Notifications & Logs:
- Winners receive a direct message (DM) with their reward details.
- The giveaway embed updates to "Terminated" with the exact end date.
- Complete logs (Creation, Manual Deletion, Winners) sent to a configured log channel.
/info: Displays bot statistics (Uptime, Latency, RAM, CPU, Active tickets, Blacklists)./profil [@user]: Displays a user's profile (Creation date, Join date, Staff/Client Status, Blacklist Status)./clear <number>: Deletes a specific number of messages (max 99)./hello: Basic test command.
The bot is configured via the config.toml file:
[roles]
staff_role_id = 123456789...
client_role_id = 123456789...
[channels]
log_channel_id = 123456789...
voice_log_channel_id = 123456789...
giveaway_log_channel_id = 123456789...
jtc_channel_ids = [123456789..., 987654321...]
[categories]
partnership = 123456789...
recruitment = 123456789...
support = 123456789...
other = 123456789...
voice_category_id = 123456789...The bot uses SQLite (database.db) to store:
- Active tickets.
- Ticket blacklist.
- Temporary voice channels.
- Ticket counters.
- Giveaways and participants.
-
Clone the repository.
-
Create a
.envfile with:DISCORD_TOKEN=your_token DISCORD_GUILD_ID=your_server_idTo find your server ID: Enable Developer Mode in Discord settings (Advanced > Developer Mode), then right-click your server icon > "Copy Server ID".
IMPORTANT: Never share your
.envfile and never commit it to Git (it is already ignored by.gitignore). -
Configure
config.toml. -
Run with
cargo run.
- Intents: This bot currently uses non-privileged intents (
GatewayIntents::non_privileged()). If you need to read message content (for old-style commands) or detect members joining, you will need to enable "Privileged Gateway Intents" on the Discord Developer Portal and modifysrc/main.rs.
If you encounter the linker 'link.exe' not found error during compilation, it means you are missing C++ build tools.
Solution:
- Download and install Visual Studio Build Tools (or Visual Studio Community).
- During installation, check the box "Desktop development with C++".
- Let the installation finish and restart your terminal (or PC).