Skip to content

Tag System v2 Reference

TIP

Throughout the tag system docs we will refer to custom commands as "cc"

INFO

Tag System v2 has breaking changes. While we don't expect further breaking changes, we reserve the right to change, modify, remove, or break tags, syntax, variables, or functionality at any time for bug fixes, improvements, or other reasons.

Tags are either a variable or a function. Function tags typically do not return a value and will be omitted from the response. On this page you will find a full list of supported tags. Tags which are not documented are unsupported and can be removed at any time.

Variables can be either a string or an array.

Variables

Args

VariableExampleDescription
{args}hello worldget all of the args
{args[0]}helloget the first arg
{args[1]}worldget the second arg
{args_array}hello|worldthe args as an array
{message}hello worldget all of the args

Member/User

{user.xxx} and {member.xxx} are interchangeable.

VariableExampleDescription
{user.id}295980401560649730the user's id
{user.name}imdarkdiamondthe user's name
{user.mention}@imdarkdiamondthe user's mention
{user.roles}12345|123456|1234567the user's roles as an array

Target Member/User

The target is only available if a target was supplied. Eg !test @imdarkdiamond

VariableExampleDescription
{target.id}295980401560649730the user's id
{target.name}imdarkdiamondthe user's name
{target.mention}@imdarkdiamondthe user's mention
{target.roles}12345|123456|1234567the user's roles as an array

Guild/Server

VariableExampleDescription
{guild.id}437808333295058955the guild's id
{guild.name}Arcanethe guilds's name
{guild.membercount} {guild.members}360290the guilds's member count
{guild.icon}https://cdn.discord.com/xxxlink to the guild's icon
{guild.owner}295980401560649730the guild's owner id

Channel

VariableExampleDescription
{channel.id}902348151170670633the channel's id
{channel.name}generalthe channel's name
{channel.mention}#generalthe channel's mention
{channel.nsfw}falseis the channel set as NSFW

Functions

Embeds

FunctionExampleDescription
{embed.title:}{embed.title:Hello World}add a title to an embed
{embed.description:}{embed.description:Hello World}add a description to an embed
{embed.footer:}{embed.title:Hello World}add a footer to an embed
{embed.field:}{embed.field:Title|Description}add a field with a title and description to an embed
{embed.color:}{embed.color:40B2B0} {embed.color:#40B2B0}add a color to an embed
{embed.timestamp}{embed.timestamp}add a timestamp to an embed
{embed.author:}{embed.author:Name|url|image url}add an author to an embed. url & image url are optional

Modify Roles

FunctionExampleDescription
{user.add_role()} {addrole:}{user.add_role(Pic perms)} {user.add_role(123456789101112)} {addrole:Pic perms}add a role to the user who triggered the cc
{user.remove_role()} {removerole:}{user.remove_role(Pic perms)} {user.remove_role(123456789101112)} {removerole:Pic perms}remove a role from the user who triggered the cc
{target.add_role()}{target.add_role(Pic perms)} {target.add_role(123456789101112)}add a role to the target user
{target.remove_role()}{target.remove_role(Pic perms)} {target.remove_role(123456789101112)}remove a role from the target user

Reactions

Premium only

Premium servers can have up to 5 react tags. Non-premium servers can have up to 2 react tags.

FunctionExampleDescription
{react:}{react:😎}add a reaction to the response

Purge

FunctionExampleDescription
{purge:}{purge:10}delete X messages from the channel. limited to 100 messages

Choose

FunctionExampleDescription
{choose:}{choose:Hello world|Bye world|What is world}choose an element from an array of items

Requirements

TIP

You can have multiple requirement functions in a cc

FunctionExampleDescription
{require_role:}{require_role:Admin} {require_role:520734047736037378}limit the cc to a role
{require_channel:}{require_channel:general} {require_channel:902348151170670633}limit the cc to a channel
{require_user:}{require_user:imdarkdiamond} {require_user:295980401560649730}limit the cc to a user
{require_permission:}{require_permission:Manage Messages} {require_perm:Admin}limit the cc to a permission
{deny_role:}{deny_role:bad} {deny_role:520734047736037378}block the cc if the user has the role
{deny_channel:}{deny_channel:general} {deny_channel:902348151170670633}block the cc in a channel
{deny_user:}{deny_user:imdarkdiamond} {deny_user:295980401560649730}block the cc from a user
{deny_permission:}{deny_permission:Manage Messages} {deny_permission:Admin}block the cc from a permission

Behavior

FunctionExampleDescription
{delete}{delete}delete the message that triggered the cc
{delete_reply:}{delete_reply:30}delete the reply after X time in seconds
{redirect:}{redirect:general} {redirect:902348151170670633}redirect the cc response to a different channel
{break:}{break:Ending early!}end the cc early and return a message

Conditionals

FunctionExampleDescription
{if(condition comparison op condition):then|else}{if({user.name}==imdarkdiamond):Hello Dark|You're not dark!}evaluates a single condition. Shows/executes then if true, else if false.
{any(condition comparison op condition|...):then|else}{any({user.name}==imdarkdiamond|{user.name}==bob):Hello Dark or Bob|You're not Dark or Bob!}evaluates multiple conditions with OR logic. Shows/executes then if at least one condition is true, otherwise else.
{all(condition comparison op condition|...):then|else}{all({user.name}==imdarkdiamond|{add:5+{args}}>10):You're Dark and {args} + 5 is greater than 10|You're not Dark or {args} + 5 is not greater than 10}evaluates multiple conditions with AND logic. Shows/executes then if every condition is true, otherwise else.

Storage

Storage is not persistent and only lives during the cc execution. Persistent storage may be provided in a future update.

FunctionExampleDescription
{=(name):value}{=(hello):world}assign "world" to the "hello" variable
{name}{hello}get the "hello" variable (if it exists)

Arrays

Arrays are defined as value0|value1|value2|....

FunctionExampleDescription
{arrayname[i]}{args[0]} {args[2]} {myarray[0]}get the element at an index from an array

Util

FunctionExampleDescription
{len:}{len:test|test1|test2} -> 3 {len:string length} -> 13get the length of an array or string
{join():}{join( ):hello|world} -> hello world {join(_):hello|world} -> hello_worldjoin elements of an array into a string
{contains(value):array} {contains(value):string}{contains(hello):hello|world} -> true {contains(world):hello world} -> truecheck an array for an element
{replace(replace|with):}{replace(hello|bye):hello world} -> bye worldreplace part of a string with another string
{uppercase:}{uppercase:hello world} -> HELLO WORLDmake a string uppercase
{lowercase:}{lowercase:HELLO WORLD} -> hello worldmake a string lowercase

Comments

FunctionExampleDescription
{#:}{#:what a cool comment}write a comment for future reference. will be ommited and never shown to the user

Math

FunctionExampleDescription
{add:}{add:5+5}add two numbers
{sub:}{sub:5-5}subtract two numbers
{multiply:}{add:5*5}multiply two numbers
{divide:}{divide:5/5}divide two numbers
{round:}{round:5.5}round a number
{floor:}{floor:5.5}round down a number
{range:}{range:1|5}generate a random number in the range