Triggers
Learn about all the triggers you can use in ItsMyBot to execute your scripts based on various events happening in your server.
The triggers are the events that will trigger the script to run. The triggers are defined in the triggers section of the script.
All Triggers
buttonClick
Triggers when a button is clicked. Only buttons starting with script_ will work. More information
- Provided Context: Guild, Member, User, Channel, Message, Interaction
| Variable | Value |
|---|---|
[[button_custom_id]] | The custom ID of the button clicked |
[[button_args_count]] | The number of custom-id arguments |
[[button_args]] | All custom-id arguments joined with , |
[[button_arg_0]] | The first custom-id argument |
[[button_arg_<index>]] | The Nth custom-id argument |
channelCreate
Triggers when a channel is created.
- Provided Context: Guild, Channel
channelDelete
Triggers when a channel is deleted.
- Provided Context: Guild, Channel
displayNameUpdate
Triggers when a user display name is updated.
- Provided Context: Guild, Member, User
everyDay
Triggers every day.
- Provided Context: Guild
| Variable | Value |
|---|---|
[[date]] | The current date |
everyHour
Triggers every hour.
- Provided Context: Guild
| Variable | Value |
|---|---|
[[hour]] | The current hour (0-23) |
everyMinute
Triggers every minute.
- Provided Context: Guild
| Variable | Value |
|---|---|
[[minute]] | The current minute (0-59) |
guildBoostAdd
Triggers when a user boosts the guild.
- Provided Context: Guild, Member, User
guildBoostRemove
Triggers when a user removes their boost from the guild.
- Provided Context: Guild, Member, User
guildMemberAdd
Triggers when a member joins the guild.
- Provided Context: Guild, Member, User
guildMemberRemove
Triggers when a member leaves the guild.
- Provided Context: Guild, Member, User
inviteCountUpdate
Triggers when the invite count is updated (increased or decreased). Require Invite Tracker addon
- Provided Context: Guild, Member, User
messageCreate
Triggers when a message is created.
- Provided Context: Guild, Member, User, Channel, Message
messageDelete
Triggers when a message is deleted.
- Provided Context: Guild, Member, User, Channel, Message
messageReactionAdd
Triggers when a reaction is added to a message.
- Provided Context: Guild, Member, User, Channel, Message
| Variable | Value |
|---|---|
[[reaction_emoji]] | The emoji of the reaction added |
messageReactionRemove
Triggers when a reaction is removed from a message.
- Provided Context: Guild, Member, User, Channel, Message
| Variable | Value |
|---|---|
[[reaction_emoji]] | The emoji of the reaction removed |
messageUpdate
Triggers when a message is updated.
- Provided Context: Guild, Member, User, Channel, Message
| Variable | Value |
|---|---|
[[message_old_content]] | The old content of the message before the update |
modalSubmit
Triggers when a modal is submitted. Only modals starting with script_ will work. More information
- Provided Context: Guild, Member, User, Channel, Interaction
| Variable | Value |
|---|---|
[[modal_custom_id]] | The custom ID of the modal |
[[modal_args_count]] | The number of custom-id arguments |
[[modal_args]] | All custom-id arguments joined with , |
[[modal_arg_0]] | The first custom-id argument |
[[modal_arg_<index>]] | The Nth custom-id argument |
Text Input Variables
For each text input component in the modal, you can use the following variables based on the custom ID of the text input:
| Variable | Value |
|---|---|
[[modal_<custom-id>]] | The value of a text input component |
Select Menu Variables
For each select menu component in the modal, you can use the following variables based on the custom ID of the select menu:
| Variable | Value |
|---|---|
[[modal_<custom-id>_values_count]] | The number of selected values in a modal select menu |
[[modal_<custom-id>_values]] | All selected values joined with , in a modal select menu |
[[modal_<custom-id>_value_0]] | The first selected value in a modal select menu |
[[modal_<custom-id>_value_<index>]] | The Nth selected value in a modal select menu |
File Upload Variables
For each file upload component in the modal, you can use the following variables based on the custom ID of the file upload:
| Variable | Value |
|---|---|
[[modal_<custom-id>_attachments_count]] | The number of uploaded files in a file upload component |
[[modal_<custom-id>_attachment_0]] | The URL of the first uploaded file |
[[modal_<custom-id>_attachment_<index>]] | The URL of the Nth uploaded file |
Checkbox Variables
For each checkbox component in the modal, you can use the following variable based on the custom ID of the checkbox:
| Variable | Value |
|---|---|
[[modal_<custom-id>]] | true if the checkbox is checked, false otherwise |
Checkbox Group Variables
For each checkbox group component in the modal, you can use the following variables based on the custom ID of the checkbox group:
| Variable | Value |
|---|---|
[[modal_<custom-id>_values_count]] | The number of selected values in a modal checkbox group |
[[modal_<custom-id>_values]] | All selected values joined with , in a modal checkbox group |
[[modal_<custom-id>_value_0]] | The first selected value in a modal checkbox group |
[[modal_<custom-id>_value_<index>]] | The Nth selected value in a modal checkbox group |
Radio Group Variables
For each radio group component in the modal, you can use the following variable based on the custom ID of the radio group:
| Variable | Value |
|---|---|
[[modal_<custom-id>]] | The selected value in a modal radio group |
presenceUpdate
Triggers when a user presence is updated.
- Provided Context: Guild, Member, User
| Variable | Value |
|---|---|
[[old_status]] | The old status of the user |
[[new_status]] | The new status of the user |
selectMenuSubmit
Triggers when a select menu is submitted. Only select menus starting with script_ will work. More information
- Provided Context: Guild, Member, User, Channel, Message, Interaction
| Variable | Value |
|---|---|
[[select_menu_custom_id]] | The custom ID of the select menu |
[[select_menu_values_count]] | The number of selected values |
[[select_menu_values]] | All selected values joined with , |
[[select_menu_value_0]] | The first selected value |
[[select_menu_value_<index>]] | The Nth selected value |
[[select_menu_args_count]] | The number of custom-id arguments |
[[select_menu_args]] | All custom-id arguments joined with , |
[[select_menu_arg_0]] | The first custom-id argument |
[[select_menu_arg_<index>]] | The Nth custom-id argument |
ticketClaim
Triggers when a ticket is claimed. Require Tickets addon
- Provided Context: Guild, Member, User, Channel
| Variable | Value |
|---|---|
[[ticket_id]] | The ID of the ticket |
[[category]] | The category of the ticket |
[[category_id]] | The ID of the category of the ticket |
ticketClose
Triggers when a ticket is closed. Require Tickets addon
- Provided Context: Guild, Member, User, Channel
| Variable | Value |
|---|---|
[[ticket_id]] | The ID of the ticket |
[[category]] | The category of the ticket |
[[category_id]] | The ID of the category of the ticket |
ticketCreate
Triggers when a ticket is created. Require Tickets addon
- Provided Context: Guild, Member, User, Channel
| Variable | Value |
|---|---|
[[ticket_id]] | The ID of the ticket |
[[category]] | The category of the ticket |
[[category_id]] | The ID of the category of the ticket |
Interaction Custom ID
The interaction-based script triggers only work when the custom-id starts with script_.
- Use buttonClick for buttons.
- Use selectMenuSubmit for select menus.
- Use modalSubmit for modals.
Basic custom-id
The simplest format is a script identifier without arguments:
script_<identifier>Example:
script_ticketCreateUse this when the interaction only needs to trigger one script and does not need extra information.
Custom ID with arguments
For more complex scenarios, you can add one or more arguments after the identifier:
script_<identifier>:<arg0>:<arg1>:...Examples:
script_ticketCreate:support
script_profileOpen:%user_id%
script_ticketPage:%channel_id%:2
script_ticketCreate:"support:vip":"high priority"This is useful when the same script needs extra information, for example a user ID, a channel ID, a page number, a category, or another dynamic value.
Because messages and modals support placeholders, the arguments can also contain dynamic values such as %user_id% or %channel_id%.
Rules
- the part before the first
:stays the real custom id - everything after
:becomes trigger arguments - if an argument contains
:, wrap it in single or double quotes
Conditions
Learn about all the conditions you can use in ItsMyBot to create dynamic and interactive scripts, commands, and components.
Target
Learn about the Target system in ItsMyBot, a powerful feature that allows you to change the context of actions, such as the member, channel, message, role, user, or guild that the action is executed on.