Custom commands
Ready-made answers triggered by a word, a pattern or a regular expression, with arguments.
A custom command posts a prepared message when somebody writes its trigger. Use them for rules, FAQs, links and the answers your team types ten times a day. They also power the Run a custom command action of automations.
Free servers can have 25 custom commands, Premium servers 250.
#Settings
- Name. Shown in the dashboard only.
- Group. Sorts commands into folders in the dashboard.
- Description. A note for your team. Members never see it.
- Message. The answer, with the full message editor and all variables.
- Case sensitive. Off by default, so
Rulesandrulesboth match. - Delete the trigger. Removes the member's message after the answer is sent.
- DM the ticket owner. Inside a ticket, sends the answer to the owner by DM instead of the channel. Outside a ticket, nothing is sent.
- DM the author. Sends the answer to whoever wrote the trigger.
- Admin only. Only dashboard roles, administrators and the owner can trigger it.
The server prefix does not apply to custom commands. If the trigger is
rules, members writerules, not$rules. Start the trigger with a character such as?or!if you want a prefix.
#Trigger types
#Strict
The message starts with the trigger, followed by a space or nothing. Trigger ?rules matches ?rules and ?rules please, but not ?rulesbook.
#Wildcard
* stands for any characters.
| Trigger | Matches |
|---|---|
apply* | apply, application, applying now |
*help | help, need help, selfhelp |
wh*list | whitelist, wh-list |
#Regex
A regular expression for anything the other two cannot do. ^(rules|regeln)$ reacts to two words. Test your pattern on a site such as regex101 before you save.
Groups of the match are available as variables. Numbered groups are {regex.1}, {regex.2} and so on. Named groups use their name:
^!ban (?<player>\w+) (?<days>\d+)${regex.player} is banned for {regex.days} days.#Arguments
Arguments take the text after the trigger. Set how many you need, up to five, and a separator, , by default. The last argument takes everything that is left.
With two arguments, the message ?warn Max, spamming in #general gives:
| Variable | Value |
|---|---|
{argument.1} | Max |
{argument.2} | spamming in #general |
With a single argument, a custom command becomes a say command: {argument.1} is everything after the trigger.