Skip to content

Formatting variables

Formatting variables let April insert Discord values into messages, embeds, image URLs, and supported editor fields.

Welcome, leaver, logs, protection messages, custom commands, managed embeds, stream monitors, and levels use single-brace variables when the message editor exposes variable buttons.

Example:

Welcome {user.mention} to {guild}. You are member {memberCount.ordinal}.

Different pages expose different data. If a variable is not available for that feature, April leaves it unchanged or replaces it with a fallback value.

VariableMeaning
{user}Username
{user.mention}Discord user mention
{user.status.color}Hex color for the user’s current status
{user.discriminator}Discord discriminator when available
{user.avatar}User avatar URL
{user.avatar.rounded}User avatar URL for image templates
{user.fullname}Full display name value available to the formatter
{user.id}Discord user ID
{user.created}Full user creation date
{user.created.date}User creation date
{user.created.ago}Relative user creation time
{user.created.time}User creation time
{user.joined}Full server join date
{user.joined.date}Server join date
{user.joined.ago}Relative server join time
{user.joined.time}Server join time
VariableMeaning
{guild}Server name
{memberCount}Approximate member count
{memberCount.ordinal}Member count as an ordinal value
{guild.id}Discord server ID
{guild.created.ago}Relative server creation time
{guild.created.date}Server creation date
{guild.created.time}Server creation time
{guild.icon}Server icon URL
{channel}Channel name
{channel.id}Discord channel ID
{channel.mention}Discord channel mention
{channel.created}Full channel creation date
{channel.created.date}Channel creation date
{channel.created.time}Channel creation time
{channel.created.ago}Relative channel creation time
{channel.nsfw}Whether the channel is marked NSFW
{channel.topic}Channel topic

Use these in level-up messages, rank-card designs, and level-related templates where the page offers them.

VariableMeaning
{user.level}User level in the server
{user.xp}XP in the current level
{user.xpRatio}Current-level progress from 0 to 1
{user.nextLevel}XP required for the next level
{user.totalXp}Total accumulated XP

Log events can expose before/after values when Discord sends both states.

VariableMeaning
{before.user}Previous username
{before.user.nickname}Previous server nickname
{before.user.avatar}Previous avatar URL
{before.user.fullname}Previous full user value
{after.user}Updated username
{after.user.nickname}Updated server nickname
{after.user.avatar}Updated avatar URL
{after.user.fullname}Updated full user value
{before.channel}Previous channel name
{before.channel.id}Previous channel ID
{before.channel.nsfw}Previous NSFW state
{before.channel.topic}Previous channel topic
{after.channel}Updated channel name
{after.channel.id}Updated channel ID
{after.channel.nsfw}Updated NSFW state
{after.channel.topic}Updated channel topic

Some log events also add event-specific values such as message content or changed roles. Use the variable buttons shown on that event’s configuration page.

Twitch notifications can use:

VariableMeaning
{stream.channel}Streamer display name
{stream.avatarUrl}Streamer avatar URL
{stream.url}Twitch channel URL
{stream.viewerCount}Viewer count
{stream.started.ago}Relative stream start time
{stream.type}Stream type
{stream.length}Stream duration
{stream.title}Stream title
{stream.preview}Stream thumbnail URL
{stream.game}Game or category

YouTube notifications can use {stream.channel.name}, {stream.channel}, {stream.url}, {stream.started.ago}, and {stream.title}.

Custom commands and other legacy message templates can use random number variables:

{random}
{random.1-100}

{random} returns a value from 0 to 10. {random.1-100} returns a value in the configured range.

Editor V2 bindings use Liquid-style output syntax instead:

VariableExample use
{{ user }}Render the selected user into text
{{ guild }}Render the server name into text
{{ channel }}Render a channel value into text

Editor V2 bindings are configured from the workspace inspector. Single-brace values such as {user} are not valid in Editor V2 bindings.

Image and icon variables must resolve to valid URLs. For example, {user.avatar}, {guild.icon}, and {stream.preview} are suitable for image URL fields when the feature supports them.