Variables
Placeholders for names, numbers, reasons and times in every message, with modifiers that shape them.
Variables are placeholders in curly braces. The bot replaces them when it sends a message, so {ticket.user} becomes a mention of the ticket owner. They work in every message, in embed fields, in channel names and in custom commands.
Unknown variables stay as they are. A typo like {tiket.user} shows up in the message, so you notice it.
#All variables
#General
| Variable | Value |
|---|---|
{server.name} | Name of the server |
{server.id} | Id of the server |
{server.icon} | Link to the server icon |
{server.banner} | Link to the server banner |
{channel.name} | Name of the channel the message is in |
{channel.id} | Id of that channel |
{panel.count} | Number of tickets the panel has opened so far |
{panel.name} | Name of the panel |
{panel.ticketLimit} | Open ticket limit per member of the panel |
{count} | Number of the ticket, padded with zeros |
#Ticket
| Variable | Value |
|---|---|
{ticket} | Mention of the ticket channel |
{ticket.id} | Id of the ticket channel |
{ticket.user} | Mention of the ticket owner |
{ticket.user.name} | Username of the owner |
{ticket.user.id} | Id of the owner |
{ticket.user.nickname} | Server nickname of the owner |
{ticket.user.icon} | Link to the avatar of the owner |
{ticket.user.full} | Full username of the owner |
#Author
| Variable | Value |
|---|---|
{author} | Mention of whoever triggered the message |
{author.name} | Username of the author |
{author.id} | Id of the author |
{author.nickname} | Server nickname of the author |
{author.icon} | Link to the avatar of the author |
{author.full} | Full username of the author |
#Special
| Variable | Value |
|---|---|
{empty} | An invisible character for fields that must not be empty |
{reason} | Reason of the current action |
{create.reason} | Reason given with $new |
{close.reason} | Reason given when closing |
{delete.reason} | Reason given when deleting |
{claim.reason} | Reason given when claiming |
{claim.user} | Mention of the latest claimer |
{claim.user.name} | Username of the latest claimer |
{create.form.1} | Answer to form question 1, up to create.form.5 |
{random} | A random number, shaped with rmin, rmax or rlist |
{escalate.reason} | Reason given with $escalate |
{escalate.panel} | Name of the panel the ticket moved to |
#Time
| Variable | Value |
|---|---|
{time} | Current Unix time in seconds |
{time.created} | When the ticket was opened |
{time.created.age} | How long ago the ticket was opened, as text |
{time.claimed} | When the ticket was last claimed |
{time.claimed.age} | Time from opening to the claim, as text |
{time.closed} | When the ticket was last closed |
{time.closed.age} | Time from opening to closing, as text |
{time.opened} | When the ticket was last reopened |
{time.opened.age} | Time from closing to reopening, as text |
{time.deleted} | When the ticket was deleted |
{time.deleted.age} | Time from opening to deleting, as text |
#More placeholders
| Variable | Value |
|---|---|
{ticket.owner} | Same as {ticket.user}, with the same sub-variables such as {ticket.owner.name} |
{user} | Same as {author}, with the same sub-variables |
{@Role Name} | Mentions the role with this name, for example {@Support} |
{123456789012345678} | Mentions the role with this id |
{argument.1} to {argument.5} | Arguments of a custom command |
{regex.NAME} and {regex.1} | Named and numbered groups of a regex trigger |
{escalate.reason} and {escalate.panel} | See Escalate |
{author}is whoever triggered the message. In the claimed message that is the claimer, not the owner. To mention the owner, use{ticket.user}.
#Times
{time} and {time.created} and the others are Unix timestamps in seconds. Wrap them in Discord's timestamp format to show a local time to every reader:
Opened <t:{time.created}:R>, that is <t:{time.created}:f>.The .age variables are plain text such as 2 hours. Actions that can happen several times, such as claiming or reopening, use the latest time.
#Modifiers
Modifiers change a value. Add them after the name with a question mark. You can chain several: {ticket.user.name?uc?ml=10}.
| Modifier | Alias | Description | Example |
|---|---|---|---|
?uppercase | ?uc | Turns the value into capitals | {ticket.user.name?uc} |
?lowercase | ?lc | Turns the value into small letters | {panel.name?lc} |
?maxLength= | ?ml= | Cuts the value after this many characters | {create.form.1?ml=20} |
?padLeft= | ?pl= | Fills with zeros on the left up to this length | {count?pl=6} |
?padRight= | ?pr= | Fills with zeros on the right up to this length | {count?pr=6} |
?fallback= | ?fb= | Shows this text when the value is empty | {close.reason?fb=none} |
?notfallback= | ?nfb= | Shows this text when the value is not empty | {claim.user?nfb=claimed} |
?math= | ?m= | Calculates with + - * / on a number | {time?m=+3600} |
?clean | – | Replaces backticks so they cannot break formatting | {create.form.2?clean} |
?rlist= | – | Lets {random} pick one of these items, split by | | {random?rlist=a|b|c} |
?rmin= | – | Lowest number {random} returns, default 0 | {random?rmin=1} |
?rmax= | – | Highest number {random} returns, default 100 | {random?rmax=6} |
#Examples
{ticket.user.name?uc} MAX
{count?pl=6} 000042
{ticket.user.nickname?fb={ticket.user.name}}
{close.reason?fb=No reason given}
{claim.user?nfb=Claimed by {claim.user}}
<t:{time?m=+3600}:t> in one hour
{random?rmin=1?rmax=6} a dice roll
{random?rlist=red|green|blue} one of three
{create.form.2?clean?ml=200}Fallback texts may contain variables themselves, as in the third line.