Variables

The variable system inserts contextual information into your messages dynamically. These variables follow a specific format and can be enriched with parameters and modifiers to customize how they are displayed.

General syntax

Variables are always used between curly braces {} and follow one of the following structures:

  • {variable}: a simple variable
  • {variable:parameters}: a variable with parameters
  • {variable?modifier}: a variable with a modifier
  • {variable:parameters?modifier}: a variable with parameters and a modifier

Example:

  • {user.username}
  • {user.created_at:format=DD/MM/YYYY}
  • {level.rank?ordinal}

Parameters

Parameters fine-tune a variable's behavior by passing it additional information. They are added after the variable's name, each of them preceded by a colon :.

Each parameter follows the name=value structure. When you want to use several parameters at once, simply add a new : followed by the next parameter.

Example:

  • {level.rank:user_id=123456789012345678}
  • {user.created_at:user_id=123456789012345678:format=DD MMMM YYYY}

Common parameters

This section gathers the parameters used by several variables. When a parameter is mentioned later without a detailed explanation, refer to this section.

user_id

Discord ID of a user targeted by the variable (mentions <@123> are supported).

  • Type: Discord ID
  • Required: depends on the variable

role_id

Discord ID of a role.

  • Type: Discord ID
  • Required: for role-related variables

This parameter is required for every role variable.

channel_id

Discord ID of a channel.

  • Type: Discord ID
  • Required: depends on the variable

format

Sets the display format of dates and times.

  • Default value: L (date) or LT (time)
  • Accepted values:
    • relative → relative display (2 hours ago, for example)
    • a custom format (DD/MM/YYYY, HH:mm, for example)

    The list of the different formats is available on this page of the documentation.

VariableFormat exampleResponse example
stream.start_atThe stream will begin on {stream.start_at:format=DD/MM/YYYY}.The stream will begin on 31/12/2025.
dateIt is {date:format=DD/MM/YYYY, HH:mm}.It is 04/03/2026, 20:14.

separator

The character(s) used to separate several values.

  • Default value: ,

style

Timestamps

Discover the different style parameters

Modifiers

Modifiers transform how variables are displayed. They are added after the variable's name, or after the parameter(s), preceded by a question mark ?.

Modifiers cannot be stacked on the same variable.

ModifierDescriptionExample
uppercaseText in uppercase{user.username?uppercase} → DRAFTBOT
lowercaseText in lowercase{server.name?lowercase} → draftbot support
capitalizeFirst letter in uppercase{user.username?capitalize} → Draftbot
ordinalOrdinal number{level.rank?ordinal} → 3rd
maxLength=NLength limit{title?maxLength=50}
formatNumberLocalized number format{money?formatNumber} → 1,234

Basic variables

User

VariableDescriptionExample
{user}The user's mention@draftbot
{user.id}The user's ID318312854816161792
{user.username}Account usernamedraftbot
{user.globalname}Global display nameDraftBot
{user.nickname}Nickname on the server❕DraftBot
{user.tag}Tag (deprecated)draftbot#0535
{user.rolecount}Number of roles2
{user.created_at}Date the account was created28/05/2017
{user.joined_at}Date they joined the server11/03/2018

Parameters:

  • user_id
  • format

For the details of the parameters, click here.

Server

VariableDescriptionExample
{server}The server's nameDraftBot Support
{server.id}The server's ID422112414964908042
{server.name}The server's nameDraftBot Support
{server.description}The server's descriptionOfficial server and Support of DraftBot
{server.membercount}Total number of members65536
{server.humancount}Number of human members65535
{server.botcount}Number of bots1
{server.rolecount}Number of roles69
{server.channelcount}Number of channels20
{server.boosts.level}The server's boost level2
{server.boosts.count}The server's number of boosts27
{server.created_at}Date the server was created10/03/2018

Parameters:

  • format

For the details of the parameters, click here.

Channel

VariableDescriptionExample
{channel}The channel's mention#chat➖🐱
{channel.id}The channel's ID700375095297835096
{channel.name}The channel's namechat➖🐱
{channel.created_at}Creation date16/04/2020
{channel.parent}The parent channel's mention#▬▬▬ Community ▬▬▬
{channel.parent.id}The parent channel's ID700370977019658332
{channel.parent.name}The parent channel's name▬▬▬ Community ▬▬▬
{channel.parent.created_at}Parent creation date16/04/2020

Parameters:

  • channel_id
  • format

For the details of the parameters, click here.

Role

VariableDescriptionExample
{role}The role's mention@Team
{role.id}The role's ID698990778084491314
{role.name}The role's nameTeam
{role.color}Hexadecimal color#FD9A60
{role.position}The role's position5
{role.membercount}Number of members13
{role.created_at}Creation date12/04/2020

Parameters:

  • role_id
  • format

For the details of the parameters, click here.

Time

VariableDescriptionExample
{date}Current date28/05/2017
{time}Current time11:01
{timestamp}Discord timestamp1495962098

Parameters:

  • format (date and time)
  • style (timestamp)

For the details of the parameters, click here.

Variables per module

Economy

VariableDescriptionExample
{money}Money1,234
{money.record}Money record5,678
{money.currency_icon}Currency icon💰
{money.rank}Position in the leaderboard3
{money.next_user}Member above in the leaderboard@DraftBot
{money.next_user.id}ID of the member above in the leaderboard318312854816161792
{money.next_user.money}Amount of money of the member above in the leaderboard2,500
{money.next_user.money_diff}Money difference with the member above in the leaderboard2,500
{money.to_position:position=N}Money needed to reach position N in the leaderboard1,200

Parameters:

  • user_id

For the details of the parameters, click here.

Levels

VariableDescriptionExample
{level}Level25
{level.rank}Position in the leaderboard5
{level.next_user}Member above in the leaderboard@DraftBot
{level.next_user.id}ID of the member above in the leaderboard318312854816161792
{level.next_user.level}Level of the member above in the leaderboard27
{level.next_user.level_diff}Level difference with the member above in the leaderboard2
{level.next_user.xp}Amount of experience of the member above in the leaderboard15,000
{level.next_user.xp_diff}Experience difference with the member above in the leaderboard2,500
{level.to_position:position=N}Levels needed to reach position N in the leaderboard5,000
{xp}Total experience12,500
{xp.current_level}Experience of the current level250
{xp.next_level}Experience needed to reach the next level750
{xp.to_level:level=N}Experience needed to reach level N15,000
{xp.to_position:position=N}Experience needed to reach position N in the leaderboard5,000

Parameters:

  • user_id

For the details of the parameters, click here.

Level rewards

VariableDescriptionExample
{reward}Reward receivedVIP role
{reward.level}Level of the reward received10
{reward.next_level}Levels before the next reward5
{reward.next_xp}Experience before the next reward2,500

The level variables are also available in level reward messages.

Tickets

VariableDescriptionExample
{number}Ticket number42

Suggestions

VariableDescriptionExample
{title}Title of the suggestionQuestionnaire system
{count}Number of ongoing suggestions3
{max}Maximum number of suggestions5

Suggestion rewards

VariableDescriptionExample
{reward}Reward received100 💰
{target.type}Status typeaccepted
{target.count}Number of suggestions10

Custom commands

Custom commands - Arguments

You can see the different arguments of custom commands on this page.

Birthdays

VariableDescriptionExample
{birthday}Birth date15 March
{birthday.next}Next birthdayIn 2 months
{age}The user's age25 years old

Parameters:

  • user_id

For the details of the parameters, click here.

The economy and level variables are also available in custom commands.

Starboards

VariableDescriptionExample
{emoji}Starboard emoji⭐
{emoji.count}Number of reactions15
{message.url}Link to the messagehttps://discord.com/...

Reports

VariableDescriptionExample
{target}Reported member@draftman
{target_message.url}Link to the reported messagehttps://discord.com/...
{reason}Reason for the reportSpam

Birthday

VariableDescriptionExample
{user}Member(s) celebrating their birthday@John, @Jane
{role}Temporary birthday role@Birthday
{gifts}Rewards granted500 💰, VIP role

Statistics

VariableDescriptionExample
{count}The channel's statistic1,250

This variable has to be present in the statistics channel's format.

Temporary voice channels

VariableDescriptionExample
{index}The channel's number5
{random_word}Predefined random wordtrampoline
{custom_word}Custom random wordunicorn

Counter

VariableDescriptionExample
{number}The indicated number4956
{discussion}The member's discussion (if any)almost at 5k

Counter rewards

VariableDescriptionExample
{number}The indicated number4956
{reward}Reward won when passing a tier5,000 💰

Advent calendar

VariableDescriptionExample
{day}Day number of the opened box15
{gift}Gift received in the opened box10,000 💰
{streak.count}Current number of consecutive openings7
{streak.record}The member's consecutive openings record15

Consecutive calendar openings

VariableDescriptionExample
{day}Day number of the opened box15
{streak.count}Current number of consecutive openings7
{streak.record}The member's consecutive openings record15
{streak.reward}Name of the reward obtained"Loyal" role

Sanction DMs

VariableDescriptionExample
{sanction.moderator}Name of the moderator behind the sanctionDraftBot
{sanction.end}End date of the temporary sanction (if applicable)in 3 days
{sanction.duration}Duration of the temporary sanction (if applicable)5 days
{sanction.reason}Reason for the sanctionAdvertising on the server

Social notification variables

YouTube

VariableDescriptionExample
{video.author}Channel nameDraftBot
{video.title}Video titleHow to use DraftBot
{video.url}Video linkhttps://youtube.com/...

Twitch

VariableDescriptionExample
{stream.author}Channel nameStreamerName
{stream.title}Stream titleDevelopment stream
{stream.game}Game being streamedJust Chatting
{stream.url}Stream linkhttps://twitch.tv/...
{stream.start_at}Start time2 hours ago
{stream.tags}Stream tagsenglish, development

Parameters:

  • format
  • separator

For the details of the parameters, click here.

Reddit

VariableDescriptionExample
{post.subreddit}Subreddit namer/discord
{post.title}Post titleQuestion about DraftBot
{post.description}Post descriptionHow do I set up…
{post.url}Post linkhttps://reddit.com/...

RSS feeds

VariableDescriptionExample
{feed.name}Feed nameDraftBot Blog
{feed.url}Feed linkhttps://draftbot.fr/...