Parsing Blocks
Parsing blocks interact with the tag invocation and affect the tag’s output in Discord.
Restriction Blocks
The following blocks allow for restriction of tags behind roles or channels, or setting tag cooldowns.
Require Block
The require block will attempt to convert the given parameter into a channel or role,
using name or ID. If the user running the tag is not in the targeted channel or doesn’t
have the targeted role, the tag will stop processing and it will send the response if
one is given. Multiple role or channel requirements can be given, and should be
split by a ,
.
- usage:
{require(<role,channel>):[response]}
- aliases:
whitelist
- payload: response, None
- parameter: role, channel
Blacklist Block
The blacklist block will attempt to convert the given parameter into a channel or role,
using name or ID. If the user running the tag is in the targeted channel or has the targeted
role, the tag will stop processing and it will send the response if one is given.
Multiple role or channel requirements can be given, and should be split by a ,
.
- usage:
{blacklist(<role,channel>):[response]}
- aliases: None
- payload: response, None
- parameter: role, channel
Cooldown Block
The cooldown block implements cooldowns when running a tag. The parameter requires 2
values to be passed: rate
and per
integers. The rate
is the number of times
the tag can be used every per
seconds.
The payload requires a key
value, which is the key used to store the cooldown.
A key should be any string that is unique. If a channel’s ID is passed as a key,
the tag’s cooldown will be enforced on that channel. Running the tag in a separate
channel would have a different cooldown with the same rate
and per
values.
The payload also has an optional message
value, which is the message to be sent
when the cooldown is exceeded. If no message is passed, the default message will be
sent instead. The cooldown message supports 2 blocks: key
and retry_after
.
- usage:
{cooldown(<rate>|<per>):<key>|[message]}
- aliases: None
- payload: key, message
- parameter: rate, per
Message Block
Message blocks modify the tag’s output.
Embed Block
An embed block will send an embed in the tag response. There are two ways to use the embed block, either by using properly formatted embed JSON from an embed generator or manually inputting the accepted embed attributes.
- JSON
Using JSON to create an embed offers complete embed customization. Multiple embed generators are available online to visualize and generate embed JSON.
- usage:
{embed(<json>)}
- aliases: None
- payload: None
- parameter: json
- Manual
The following embed attributes can be set manually -
title
description
color
url
thumbnail
image
footer
field
- (see below) Adding a field to an embed requires the payload to be split by|
,;
or,
into either 2 or 3 parts. The first part is the name of the field, the second is the text of the field, and the third optionally specifies whether the field should be inline.- usage:
{embed(<attribute>):<value>}
- aliases: None
- payload: value
- parameter: attribute
Both methods can be combined to create an embed in a tag. The following tagscript uses JSON to create an embed with fields and later set the embed title.
Redirect Block
Redirects the tag response to either the given channel, the author’s DMs, or uses a reply based on what is passed to the parameter.
- usage:
{redirect(<"dm"|"reply"|channel>)}
- aliases: None
- payload: None
- parameter:
dm
,reply
or channel
Delete Block
Delete blocks will delete the invocation message if the given parameter is true.
If there is no parameter i.e. {delete}
it will default to true.
- usage:
{delete([bool])}
- aliases: None
- payload: None
- parameter: bool, None
React Block
The react block will react with up to 5 emoji to the tag response message.
If the name used is reactu
, it will react to the tag invocation instead.
The given emoji can be custom or unicode emoji. Emojis can be split with ,
.
The block accepts emojis being passed to the parameter or the payload, but not both.
- usage:
{react(<emoji,emoji>):[emoji,emoji]}
- aliases:
reactu
- payload: emoji
- parameter: emoji
Utility Blocks
The following utility blocks extend the power of tags that interface with bot commands.
Command Block
Run a command as if the tag invoker had ran it. Only 3 command blocks can be used in a tag.
- usage:
{command:<command>}
- aliases:
c
,com
andcommand
- payload: command
- parameter: None
Override Block
Override a command’s permission requirements. This can override mod, admin, or general user permission requirements when running commands with the Command Block. Passing no parameter will default to overriding all permissions.
In order to add a tag with the override block, the tag author must have Manage Server
permissions.
This will not override bot owner commands or command checks.
- usage:
{override(["admin"|"mod"|"permissions"]):[command]}
- aliases: None
- payload: command
- parameter:
admin
,mod
orpermissions
AllowedMentions Block
The allowedmentions
block attempts to enable mentioning of roles. Passing no parameter
enables mentioning of all roles within the message content. However passing a role name or
ID to the block parameter allows mentioning of that specific role only. Multiple role
name or IDs can be included, separated by a comma ,
. By default, mentioning is only
triggered if the execution author has Manage Server
permissions. However, using
the override
keyword as a payload allows mentioning to be triggered by anyone.
- usage:
{allowedmentions(<role, None>):["override", None]}
- aliases:
mentions
- payload:
override
or None - parameter: role, None