Automations
Last updated Sep 28, 2026Open in dashboard

Automations - Variables

Messages sent by Send a message, Reply to the message, Send the member a direct message and Post a log message use templates you save in the Message Builder. Set the member nickname and Create a thread take text with variables too. When a rule runs, these variables are filled in from the event that triggered it and from the rule itself:

TemplateSlugVariable groups
Automation action message@automations.actionMember, Server, Channel, Message, Reaction, Moderation, Levels and anti-raid, Changes, Invite, Role, Rule, Match, Spam

Member

VariableDescription
{user}Mention of the member behind the event
{user.mention}Mention of the member
{user.name}Their display name
{user.display_name}Their display name
{user.id}Their user ID
{user.tag}Their tag, for example name or name#1234
{user.avatar}Their avatar URL
{user.created_at}When their account was created, as a Discord timestamp (3 years ago)
{user.joined_at}When they joined the server, as a Discord timestamp
{user.roles}Mentions of their roles, comma separated (empty for a user who left)
{user.status}Their online status: online, idle, dnd or offline (needs presences)
{user.server_tag}The server tag shown next to their name, if they wear one
{user.boosting_since}When they started boosting, as a Discord timestamp (empty when not boosting)
{author}Same as {user}
{author.mention}Same as {user.mention}
{author.name}Their username
{author.display_name}Their display name
{author.id}Their user ID
{author.tag}Their tag
{author.avatar}Their avatar URL

Server

VariableDescription
{server}The server name
{server.name}The server name
{server.id}The server ID
{server.member_count}The member count
{server.boost_level}The server's boost level: 0 to 3

Channel

VariableDescription
{channel}Mention of the channel where it happened
{channel.mention}Mention of the channel
{channel.name}The channel name
{channel.id}The channel ID
{channel.type}The channel's type (text, voice, public_thread, forum...)
{thread.parent}Mention of the channel a thread is in (events in a thread)
{thread.tags}A forum post's tags, comma separated (thread triggers)

Message

VariableDescription
{message.content}The text of the message behind the event
{message.id}Its ID
{message.jump_url}A link to it
{message.link}Same as {message.jump_url}
{message.author}Mention of who wrote the message (for a reaction: not who reacted)
{message.author.name}Their display name
{message.author.id}Their user ID

Reaction

VariableDescription
{reaction.emoji}The emoji added or removed, as it shows in a message (reaction triggers)
{reaction.name}The emoji's name: the character, or a server emoji's name
{reaction.id}A server emoji's ID (empty for a standard emoji)
{reaction.url}A server emoji's image URL (empty for a standard emoji)
{reaction.count}How many of this reaction the message has now

Moderation

VariableDescription
{case.number}The case number (moderation triggers)
{case_type}The case type (warn, timeout, ban...)
{reason}The case's reason (or the anti-raid level change's)
{duration}The timeout or ban length, if any
{timeout.end}How a timeout ended: lifted or ran out (timeout ended trigger)
{mod}Mention of the moderator (or of who changed the anti-raid level)
{mod.mention}Same as {mod}
{mod.name}Their username
{mod.display_name}Their display name
{mod.id}Their user ID
{mod.tag}Their tag

Levels and anti-raid

VariableDescription
{level}The level reached (level-up triggers)
{level_before}The level before
{xp_type}Which XP: text or voice
{antiraid.level}The anti-raid level now (anti-raid trigger)

Changes

VariableDescription
{before.content}An edited message's text before the edit, when the bot still had it
{before.nick}The member's name before (member changes)
{after.nick}Their name after
{changes}What changed about the member: roles, nickname, boost (member changes)
{boost}started or stopped when they started or stopped boosting, else empty
{roles.added}Mentions of the roles the member was given (member changes)
{roles.removed}Mentions of the roles the member lost
{status}Their new custom status (custom status trigger)
{before.status}Their custom status before
{voice.action}What they did in voice: joined, left, moved, muted, started streaming...
{before.channel}The voice channel they were in before (voice trigger)
{after.channel}The voice channel they are in now
{voice.members}People (not bots) in the voice channel now: the one joined, or the one left
{voice.duration}On a leave, how long they were in voice (empty when not known)
{before.name}A role's or thread's name before (role and thread updates)
{after.name}Its name after
{before.color}A role's colour before
{after.color}A role's colour after
{permissions.added}Permissions a role gained, comma separated
{permissions.removed}Permissions a role lost, comma separated
{before.level}The anti-raid level before (anti-raid trigger)
{after.level}The anti-raid level after

Invite

VariableDescription
{invite.code}The invite's code (invite created; on a join, the invite they used)
{invite.url}The invite link
{invite.channel}Mention of the channel it leads to
{invite.max_uses}How many uses it allows (unlimited when no limit)
{invite.max_age}How long it lasts (never when it does not expire)
{invite.is_temporary}Whether it grants temporary membership: yes or no
{inviter}Mention of who made the invite a member joined with (member joins)
{inviter.id}Their user ID
{member.rejoined}Whether the member was in the server before: yes or no (member joins)

Role

VariableDescription
{role}Mention of the role (role updated trigger)
{role.mention}Same as {role}
{role.name}The role's name
{role.id}The role's ID
{role.color}The role's colour

Rule

VariableDescription
{rule.id}The rule's ID
{rule.name}The rule's name
{rule.description}The rule's description (empty if not set)
{trigger.type}The trigger's internal name, for example on_message
{trigger.label}The trigger as the dashboard names it
{actions.summary}The rule's actions, comma separated

Match

VariableDescription
{match.summary}What the conditions (or the spam threshold) matched, on one line
{match.condition}The condition that matched first, as the dashboard names it
{match.value}What that condition listed that matched (a word, pattern, domain...)
{match.text}What was found: the text around a word, a link, a file name
{match.source}Where it was found, for example the message or their nickname

Spam

VariableDescription
{spam.count}How many messages are behind the match (joins or threads for the server-wide triggers)
{spam.amount}The threshold's amount
{spam.window}The threshold's window in seconds
{spam.types}The detectors that matched
{spam.archive_url}A link to the archive of the messages behind the match

Every template also takes the Utility variables.

When each group is filled in:

  • Member: the trigger has a member, a message author, or (for a moderation event on someone who already left) a user. {user.name} is their display name and {author.name} their username. For a reaction, the member is who reacted. {user.created_at} and {user.joined_at} are Discord timestamps, which every reader sees in their own time and language ("3 years ago").
  • Server: always.
  • Channel: the trigger has a channel or a message. {thread.parent} is filled when the event happened in a thread.
  • Message: message and spam triggers, and reactions (the message reacted to). {message.author} is who wrote it, which for a reaction is usually someone other than {user}.
  • Reaction: the reaction triggers. {reaction.emoji} shows the emoji as Discord does; {reaction.id} and {reaction.url} are only set for a server emoji.
  • Moderation: the moderation triggers. {mod} and the other moderator variables are empty when nobody acted (a timeout that ran out). {timeout.end} is set on When a member's timeout ends.
  • Levels and anti-raid: {level}, {level_before} and {xp_type} on the level-up triggers, {antiraid.level} on the anti-raid trigger ({mod} is then the staff member who changed it, and empty when the detector, decay or a rule did).
  • Changes: what an update changed. A member change fills {roles.added}, {roles.removed}, {before.nick} and {after.nick}; a custom status {status} and {before.status}; a voice change {voice.action}, {before.channel} and {after.channel}; a role update the names, colours and permissions before and after; a thread update {before.name} and {after.name} (when the bot still had the thread's old version); the anti-raid trigger {before.level} and {after.level}; an edited message {before.content} (when the bot still had the message).
  • Invite: When an invite is created.
  • Role: When a role is updated: the role as it is now.
  • Rule: always. {actions.summary} lists the rule's actions, whether or not each one succeeds.
  • Match: {match.summary} says what the conditions matched (the words, patterns, links, invites and file types of the conditions that made the rule pass, and where they were found) or, on a spam trigger, the spam match, for example message spam: 6 events (threshold 5 in 10s). The other match variables describe the first condition that matched. They are empty when no content, link, invite, file or name condition matched.
  • Spam: spam triggers. {spam.count} is how many messages are behind the match (for a join raid or thread spam: how many members joined or threads were created), {spam.archive_url} a link to the archive of those messages (a web page kept for 30 days; empty for join raids and thread spam, or without the Mod Logs module). On Any spam detected, which can match several detectors at once, {spam.amount} and {spam.window} are those of the first detector that matched.

Which trigger fills what

TriggerVariables it fills
When a message is sentMember; Server; Channel; Message; Changes ({before.content}); Rule; Match
When a member joinsMember; Server; Invite ({invite.code}, {inviter}, {inviter.id}, {member.rejoined}); Rule; Match
When a member leavesMember; Server; Rule; Match
When a reaction is addedMember; Server; Channel; Message; Reaction; Rule; Match
When a reaction is removedMember; Server; Channel; Message; Reaction; Rule; Match
When a member changes (roles, nickname or boosting)Member; Server; Changes ({before.nick}, {after.nick}, {changes}, {boost}, {roles.added}, {roles.removed}); Rule; Match
When a voice state changes (join, leave, move, mute)Member; Server; Channel ({channel}, {channel.mention}, {channel.name}, {channel.id}, {channel.type}); Changes ({voice.action}, {before.channel}, {after.channel}, {voice.members}, {voice.duration}); Rule; Match
When a thread is createdMember; Server; Channel; Rule; Match
When a thread is deletedMember; Server; Channel; Rule; Match
When a thread is updatedMember; Server; Channel; Changes ({before.name}, {after.name}); Rule; Match
When a thread is archivedMember; Server; Channel; Rule; Match
When a thread is unarchivedMember; Server; Channel; Rule; Match
On a time schedule (cron-like)Server; Rule
When an invite is createdMember; Server; Channel ({channel}, {channel.mention}, {channel.name}, {channel.id}, {channel.type}); Invite ({invite.code}, {invite.url}, {invite.channel}, {invite.max_uses}, {invite.max_age}, {invite.is_temporary}); Rule; Match
When a channel is createdServer; Channel ({channel}, {channel.mention}, {channel.name}, {channel.id}, {channel.type}); Rule; Match
When a role is updatedServer; Changes ({before.name}, {after.name}, {before.color}, {after.color}, {permissions.added}, {permissions.removed}); Role; Rule; Match
When a member changes their custom statusMember; Server; Changes ({status}, {before.status}); Rule; Match
When a member is warnedMember; Server; Moderation ({case.number}, {case_type}, {reason}, {mod}, {mod.mention}, {mod.name}, {mod.display_name}, {mod.id}, {mod.tag}); Rule; Match
When a member is timed outMember; Server; Moderation ({case.number}, {case_type}, {reason}, {duration}, {mod}, {mod.mention}, {mod.name}, {mod.display_name}, {mod.id}, {mod.tag}); Rule; Match
When a member is kickedMember; Server; Moderation ({case.number}, {case_type}, {reason}, {mod}, {mod.mention}, {mod.name}, {mod.display_name}, {mod.id}, {mod.tag}); Rule; Match
When a member is bannedMember; Server; Moderation ({case.number}, {case_type}, {reason}, {duration}, {mod}, {mod.mention}, {mod.name}, {mod.display_name}, {mod.id}, {mod.tag}); Rule; Match
When a member is unbannedMember; Server; Moderation ({case.number}, {case_type}, {reason}, {mod}, {mod.mention}, {mod.name}, {mod.display_name}, {mod.id}, {mod.tag}); Rule; Match
When a member's timeout endsMember; Server; Moderation ({case.number}, {case_type}, {reason}, {timeout.end}, {mod}, {mod.mention}, {mod.name}, {mod.display_name}, {mod.id}, {mod.tag}); Rule; Match
When a note is added to a memberMember; Server; Moderation ({case.number}, {case_type}, {reason}, {mod}, {mod.mention}, {mod.name}, {mod.display_name}, {mod.id}, {mod.tag}); Rule; Match
Any spam detectedMember; Server; Channel; Message; Rule; Match; Spam
Message spam detectedMember; Server; Channel; Message; Rule; Match; Spam
Mention spam detectedMember; Server; Channel; Message; Rule; Match; Spam
Link spam detectedMember; Server; Channel; Message; Rule; Match; Spam
Attachment spam detectedMember; Server; Channel; Message; Rule; Match; Spam
Emoji spam detectedMember; Server; Channel; Message; Rule; Match; Spam
Line spam detectedMember; Server; Channel; Message; Rule; Match; Spam
Character spam detectedMember; Server; Channel; Message; Rule; Match; Spam
Sticker spam detectedMember; Server; Channel; Message; Rule; Match; Spam
Join raid detectedMember; Server; Rule; Match; Spam
Thread creation spam detectedMember; Server; Channel; Rule; Match; Spam
When anti-raid level changesServer; Moderation ({reason}, {mod}, {mod.mention}, {mod.name}, {mod.display_name}, {mod.id}, {mod.tag}); Levels and anti-raid ({antiraid.level}); Changes ({before.level}, {after.level}); Rule; Match
When a member levels up via text XPMember; Server; Levels and anti-raid ({level}, {level_before}, {xp_type}); Rule; Match
When a member levels up via voice XPMember; Server; Levels and anti-raid ({level}, {level_before}, {xp_type}); Rule; Match

Variables that do not apply to an event are not filled in; for example a scheduled rule has no {user} or {channel}, so avoid them in scheduled messages. Some of these can still be empty on a trigger that fills them, as the notes above say: {voice.duration} for someone who joined voice before the bot started, {mod} when nobody acted. {match.summary} is written for Discord: formatting characters and mentions in the matched text are escaped. {match.value} and {match.text} are the plain text.

The Message Builder lists these variables for a template whose ID starts with automations.action, for example automations.action.invite-warning. Create template on an action gives the new template such an ID. Any template works with an action; the ID only decides what the variable list shows. Opened from a rule (Create template or Edit on one of its actions), the builder lists only the variables the rule's trigger fills, and so do the variable suggestions in an action's own text fields (a nickname, a thread name); Show all in the builder lists the rest, for a template several rules share.

In message templates, filters work as everywhere else, for example {message.content | truncate(100)} or {user.display_name | upper}. Nicknames and thread names take the plain variables only, without filters. See the Message Builder guide for the filters and the Utility variables every template has.