tb!ticket) and a set of component interactions — buttons and a select menu — that drive the entire ticket lifecycle. All component interactions are identified by their custom_id values, which are hardcoded in main.py. Understanding both the command and the interaction surface is essential for operating and extending the bot.
Text Commands
tb!ticket
Sends the ticket panel embed into the current channel. This is the entry point for the entire ticket system; users open tickets by clicking the button that this command posts.
What it sends:
- A Discord embed with the title “Tickets” and the description “Welcome to tickets system.”
- A banner image pulled from
https://i.imgur.com/FoI5ITb.png - A single green 🔧 Create a ticket button (custom_id:
Ticket)
The default bot prefix is
tb!, set in the ComponentsBot constructor: bot = ComponentsBot('tb!', help_command=None). You can change 'tb!' to any string you prefer.Component Interactions
Component interactions are triggered when users click buttons or select options from a dropdown. The bot routes each interaction by inspectinginteraction.component.custom_id.
Button: Ticket
Triggered by: clicking the green 🔧 Create a ticket button on the ticket panel embed.
When clicked, the bot responds with a select menu (custom_id: "menu") containing three ticket category options:
The select menu placeholder text reads “How can we help you?”.
Select: menu
Triggered by: the user selecting one of the three options from the category select menu.
The bot reads interaction.values[0] to determine which category was chosen and then creates a private ticket channel under id_category. Each option results in a differently-named and -titled channel:
After creating the channel, the bot:
- Restricts
@everyonefrom reading or sending messages in the new channel. - Grants the ticket creator full read/write/reaction/embed/file/history/external-emoji access.
- Grants the staff role the same permissions plus
manage_messages. - Sends the user a confirmation message (auto-deletes after 3 seconds) mentioning the new channel.
- Posts a welcome embed with two action buttons — 🔐 Close ticket (
close_ticket) and 🔔 Call staff (call_staff) — inside the new channel.
Button: call_staff
Triggered by: clicking the 🔔 Call staff button inside an open ticket channel.
Sends a message in the ticket channel that pings the configured staff role (<@&id_staff_role>) alongside an embed:
🔔 {author.mention} has called the staff.
The message is automatically deleted after 20 seconds.
Button: close_ticket
Triggered by: clicking the 🔐 Close ticket button inside an open ticket channel.
Sends a confirmation embed in the ticket channel mentioning the user who clicked:
⚠️ Are you sure you want to close the ticket?The confirmation message includes two inline buttons: a green Yes button (
close_yes) and a red No button (close_no).
Button: close_yes
Triggered by: clicking the green Yes button on the close confirmation message.
Permanently deletes the current ticket channel and then sends a log embed to the channel configured as id_channel_ticket_logs. The log embed contains: