Denizen Script Events


Events are a way to listen to things that happened on your server and respond to them through a script. These usually pair with 'world' script containers.
Learn about how events work in The Beginner's Guide.


Showing 18 out of 382 events...
Namediscord application|slash|message|user command
Event Lines discord application|slash|message|user command
Triggerswhen a Discord user uses an application command.
Generated Exampleson discord application command:
after discord user command:
Switchesfor:<bot> to only process the event for a specified Discord bot.
channel:<channel_id> to only process the event when it occurs in a specified Discord channel.
group:<group_id> to only process the event for a specified Discord group.
name:<command_name> to only process the event for a specified Discord application command. Spaces are replaced with underscores.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.channel> returns the DiscordChannelTag.
<context.group> returns the DiscordGroupTag.
<context.interaction> returns the DiscordInteractionTag.
<context.command> returns the DiscordCommandTag.
<context.options> returns the supplied options as a MapTag.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordApplicationCommandScriptEvent.java#L8

Namediscord button clicked
Event Lines discord button clicked
Triggerswhen a Discord user clicks a button.
Generated Exampleson discord button clicked:
after discord button clicked:
Switchesfor:<bot> to only process the event for a specified Discord bot.
channel:<channel_id> to only process the event when it occurs in a specified Discord channel.
group:<group_id> to only process the event for a specified Discord group.
id:<button_id> to only process the event for a specified Discord button.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.channel> returns the DiscordChannelTag.
<context.group> returns the DiscordGroupTag.
<context.interaction> returns the DiscordInteractionTag.
<context.button> returns the DiscordButtonTag.
<context.message> returns the relevant message the button was on.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordButtonClickedScriptEvent.java#L10

Namediscord channel created
Event Lines discord channel created
Triggerswhen a Discord channel is created.
Generated Examplesafter discord channel created:
Switchesfor:<bot> to only process the event for a specified Discord bot.
group:<group_id> to only process the event for a specified Discord group.
type:<type> to only process the event if the channel is a specific channel_type.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.group> returns the DiscordGroupTag.
<context.channel> returns the new DiscordChannelTag.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordChannelCreateScriptEvent.java#L11

Namediscord channel deleted
Event Lines discord channel deleted
Triggerswhen a Discord channel is created.
Generated Exampleson discord channel deleted:
after discord channel deleted:
Switchesfor:<bot> to only process the event for a specified Discord bot.
group:<group_id> to only process the event for a specified Discord group.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.group> returns the DiscordGroupTag.
<context.channel> returns the DiscordChannelTag.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordChannelDeleteScriptEvent.java#L11

Namediscord command autocomplete
Event Lines discord command autocomplete
Triggerswhen a Discord user queries a slash command option that can be autocompleted.
Example
# Suggests fruits that are only longer in length than the current input.
on discord command autocomplete name:eat option:fruit:
- define length <context.options.get[fruit].length>
- define fruits <list[lime|apple|orange|blueberry|dragonfruit]>
- determine choices:<[fruits].filter_tag[<[filter_value].length.is_more_than[<[length]>]>]>
Example
# Suggests the 25 best-matching selections from some dataset against the current input.
on discord command autocomplete:
- define value <context.options.get[<context.focused_option>]>
- determine choices:<server.flag[dataset].sort_by_number[difference[<[value]>]].first[25].if_null[<list>]>
Switchesfor:<bot> to only process the event for a specified Discord bot.
channel:<channel_id> to only process the event when it occurs in a specified Discord channel.
group:<group_id> to only process the event for a specified Discord group.
name:<command_name> to only process the event for a specified Discord application command. Spaces are replaced with underscores.
option:<option_name> to only process the event for a specified autocompletable option.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.channel> returns the DiscordChannelTag.
<context.group> returns the DiscordGroupTag.
<context.interaction> returns the DiscordInteractionTag.
<context.command> returns the DiscordCommandTag.
<context.options> returns the supplied options as a MapTag.
<context.focused_option> returns the name of the focused option.
Determine"CHOICES:<ListTag>" to suggest values to the Discord client. Up to 25 suggestions are allowed to be sent. Each entry can be an ElementTag which controls both the value and display of the choice or a MapTag with "name" and "value" keys to control both separately.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordCommandAutocompleteScriptEvent.java#L18

Namediscord message deleted
Event Lines discord message deleted
Triggerswhen a Discord user deletes a message.
Generated Examplesafter discord message deleted:
Switchesfor:<bot> to only process the event for a specified Discord bot.
channel:<channel_id> to only process the event when it occurs in a specified Discord channel.
group:<group_id> to only process the event for a specified Discord group.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.channel> returns the DiscordChannelTag.
<context.group> returns the DiscordGroupTag.
<context.old_message_valid> returns whether the old message is available (it may be lost due to caching).
<context.old_message> returns the original DiscordMessageTag (data may be missing if not cached).
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordMessageDeletedScriptEvent.java#L18

Namediscord message modified
Event Lines discord message modified
Triggerswhen a Discord user modified a message.
Generated Exampleson discord message modified:
after discord message modified:
Switchesfor:<bot> to only process the event for a specified Discord bot.
channel:<channel_id> to only process the event when it occurs in a specified Discord channel.
group:<group_id> to only process the event for a specified Discord group.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.channel> returns the DiscordChannelTag.
<context.group> returns the DiscordGroupTag.
<context.new_message> returns the message as it now exists, as a DiscordMessageTag.
<context.old_message_valid> returns whether the old message is available (it may be lost due to caching).
<context.old_message> returns the original DiscordMessageTag (data may be missing if not cached).
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordMessageModifiedScriptEvent.java#L20

Namediscord message reaction added
Event Lines discord message reaction added
Triggerswhen a Discord user added a reaction to a message.
Generated Exampleson discord message reaction added:
after discord message reaction added:
Switchesfor:<bot> to only process the event for a specified Discord bot.
channel:<channel_id> to only process the event when it occurs in a specified Discord channel.
group:<group_id> to only process the event for a specified Discord group.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.channel> returns the DiscordChannelTag.
<context.group> returns the DiscordGroupTag.
<context.message> returns the message.
<context.user> returns the user that added the reaction.
<context.reaction> returns the new reaction.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordMessageReactionAddScriptEvent.java#L10

Namediscord message reaction removed
Event Lines discord message reaction removed
Triggerswhen a Discord user removes a reaction from a message.
Generated Examplesafter discord message reaction removed:
Switchesfor:<bot> to only process the event for a specified Discord bot.
channel:<channel_id> to only process the event when it occurs in a specified Discord channel.
group:<group_id> to only process the event for a specified Discord group.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.channel> returns the DiscordChannelTag.
<context.group> returns the DiscordGroupTag.
<context.message> returns the DiscordMessageTag.
<context.user> returns the DiscordUserTag that removed the reaction.
<context.reaction> returns the old DiscordReactionTag.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordMessageReactionRemoveScriptEvent.java#L10

Namediscord message received
Event Lines discord message received
Triggerswhen a Discord bot receives a message.
Generated Exampleson discord message received:
Switchesfor:<bot> to only process the event for a specified Discord bot.
channel:<channel_id> to only process the event when it occurs in a specified Discord channel.
group:<group_id> to only process the event for a specified Discord group.
message:<message> to only process the event if the message matches some matcher text, like 'message:*hello*' to match any message that contains the word 'hello'.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.channel> returns the DiscordChannelTag.
<context.group> returns the DiscordGroupTag.
<context.new_message> returns the message received, as a DiscordMessageTag.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordMessageReceivedScriptEvent.java#L19

Namediscord modal submitted
Event Lines discord modal submitted
Triggerswhen a Discord user submits a modal.
Generated Exampleson discord modal submitted:
Switchesfor:<bot> to only process the event for a specified Discord bot.
channel:<channel_id> to only process the event when it occurs in a specified Discord channel.
group:<group_id> to only process the event for a specified Discord group.
name:<modal_name> to only process the event for a specified Discord modal.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.channel> returns the DiscordChannelTag.
<context.group> returns the DiscordGroupTag.
<context.interaction> returns the DiscordInteractionTag.
<context.name> returns the name of the modal.
<context.values> returns a MapTag of the values submitted by the user.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordModalSubmittedScriptEvent.java#L18

Namediscord selection used
Event Lines discord selection used
Triggerswhen a Discord user uses a selection menu.
Generated Examplesafter discord selection used:
on discord selection used:
Switchesfor:<bot> to only process the event for a specified Discord bot.
channel:<channel_id> to only process the event when it occurs in a specified Discord channel.
group:<group_id> to only process the event for a specified Discord group.
id:<menu_id> to only process the event for a specified Discord selection menu.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.channel> returns the DiscordChannelTag.
<context.group> returns the DiscordGroupTag.
<context.interaction> returns the DiscordInteractionTag.
<context.menu> returns the selection menu as a DiscordSelectionTag.
<context.option> returns the selected option as a MapTag.
<context.message> returns the relevant message the selection was on.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordSelectionUsedScriptEvent.java#L11

Namediscord user joins
Event Lines discord user joins
Triggerswhen a Discord user joins a guild.
Generated Examplesafter discord user joins:
on discord user joins:
Switchesfor:<bot> to only process the event for a specified Discord bot.
group:<group_id> to only process the event for a specified Discord group.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.group> returns the DiscordGroupTag.
<context.user> returns the DiscordUserTag.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordUserJoinsScriptEvent.java#L11

Namediscord user leaves
Event Lines discord user leaves
Triggerswhen a Discord user leaves a guild.
Generated Exampleson discord user leaves:
after discord user leaves:
Switchesfor:<bot> to only process the event for a specified Discord bot.
group:<group_id> to only process the event for a specified Discord group.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.group> returns the DiscordGroupTag.
<context.user> returns the DiscordUserTag.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordUserLeavesScriptEvent.java#L11

Namediscord user nickname changes
Event Lines discord user nickname changes
Triggerswhen a Discord user's nickname change.
Generated Examplesafter discord user nickname changes:
Switchesfor:<bot> to only process the event for a specified Discord bot.
group:<group_id> to only process the event for a specified Discord group.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.group> returns the DiscordGroupTag.
<context.user> returns the DiscordUserTag.
<context.old_name> returns the user's previous nickname (if any).
<context.new_name> returns the user's new nickname (if any).
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordUserNicknameChangeScriptEvent.java#L12

Namediscord user role changes
Event Lines discord user role changes
Triggerswhen a Discord user's roles change.
Generated Examplesafter discord user role changes:
on discord user role changes:
Switchesfor:<bot> to only process the event for a specified Discord bot.
group:<group_id> to only process the event for a specified Discord group.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.group> returns the DiscordGroupTag.
<context.user> returns the DiscordUserTag.
<context.old_roles> returns a ListTag of the user's previous DiscordRoleTag set.
<context.new_roles> returns a ListTag of the user's new DiscordRoleTag set.
<context.added_roles> returns a ListTag of the user's added DiscordRoleTag set.
<context.removed_roles> returns a ListTag of the user's removed DiscordRoleTag set.
GroupDiscord
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordUserRoleChangeScriptEvent.java#L18

Namediscord thread archived
Event Lines discord thread archived
Triggerswhen a Discord thread is archived.
Generated Examplesafter discord thread archived:
Switchesfor:<bot> to only process the event for a specified Discord bot.
group:<group_id> to only process the event for a specified Discord group.
parent:<channel_id> to only process the event for a specific parent channel ID.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.group> returns the DiscordGroupTag.
<context.thread> returns the thread DiscordChannelTag.
GroupDiscord
RequiresdDiscordBot
Warning(s)Not currently function. Will likely function in the future.
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordThreadArchivedScriptEvent.java#L11

Namediscord thread revealed
Event Lines discord thread revealed
Triggerswhen a Discord thread is pulled out of archive.
Generated Examplesafter discord thread revealed:
Switchesfor:<bot> to only process the event for a specified Discord bot.
group:<group_id> to only process the event for a specified Discord group.
parent:<channel_id> to only process the event for a specific parent channel ID.
Contexts<context.bot> returns the relevant DiscordBotTag.
<context.group> returns the DiscordGroupTag.
<context.thread> returns the thread DiscordChannelTag.
GroupDiscord
RequiresdDiscordBot
Warning(s)Not currently function. Will likely function in the future.
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/events/DiscordThreadRevealedScriptEvent.java#L11