Skip to content

Maintenance: We are currently setting up all Infrastructure - Please be patient.

Docs menu · Custom commands
Server

Custom commands

Replies you write once and the bot posts on a trigger, with arguments and follow-ups.

A custom command is a reply you write once. The bot posts it whenever somebody writes its trigger. On a roleplay server that could be the connect address, the steps to the whitelist, the donation rules or the link to the faction request.

A Free server holds up to 25 custom commands, a Premium server up to 250. Automations can send a custom command as their action too.

#Triggers

The trigger is the text that sets a command off. The bot compares messages with it exactly as you typed it. The server prefix plays no part: a trigger needs none, and changing the prefix never changes a trigger. If your commands should look like commands, start the trigger with a character of your choice, such as .ip or ?ip.

There are three trigger types.

#Strict

The message has to begin with the trigger, and right after it the message ends or a space follows. With the trigger .whitelist:

MessageFires
.whitelistYes
.whitelist how long does it takeYes, the rest goes to the arguments
.whitelistedNo, the word goes on
where is the .whitelistNo, the trigger is not at the start

#Wildcard

A * stands for any text, also for none. The pattern has to cover the whole message.

TriggerFires onStays silent on
when*restartwhen is the next restart, When restartwhen is the restart today
*faction requestfaction request, where do I send a faction requestfaction request please
*donat*donation, how can I donate, Donator perksgift

One exception: if the pattern fits the first word of a message on its own, the command fires as well, and the words after it go to the arguments.

#Regex

For patterns with rules of their own, the trigger can be a regular expression. It may match anywhere in the message. Anchor it with ^ and $ when it should cover the whole message: ^[.?]ip$ fires on .ip and on ?ip, on nothing else.

What a group in round brackets catches can be used in the reply. {regex.1} holds the first group, {regex.2} the second. Name a group and its name works too:

Trigger
^\.name (?<first>[a-z]+) (?<last>[a-z]+)$
Reply
In-game name noted: {regex.first} {regex.last}.

.name Mara Lindt gets the reply In-game name noted: Mara Lindt.

#Spelling and testing

Case sensitive is off at first. The bot then makes no difference between capital and small letters, in all three types. Switch it on when a trigger should fire only in your exact spelling.

Below the trigger, the editor has a field for a test message. Type what a member would write. The editor shows at once whether the command fires, which text is left for the arguments and what each argument and regex group holds. Nothing is sent to Discord, and the check is the same one the bot runs. A regular expression with an error is reported there as well.

#The reply

The reply is a message from the full message editor, with text, embeds and all variables. These switches decide where it goes and who may ask for it:

  • Answer by DM. The reply goes by DM to whoever wrote the trigger, not into the channel.
  • Send to the ticket owner by DM. In a ticket the owner gets the reply by DM and nothing appears in the channel. Outside a ticket nothing is sent. With both DM switches on, this one decides.
  • Delete trigger message. The bot removes the message that set off the command as soon as the reply is out.
  • Add close button. In an open ticket the reply carries the close button of the panel, with its label, colour and access rules, even when the ticket message hides that button. That suits a reply such as All sorted? Then close the ticket here. It is left out in DMs and outside tickets.
  • Admins only. The command is reserved for admins, level 2 and higher among the permission levels. For anyone else the bot stays silent.

Name, group and description of a command exist in the dashboard only. The group sorts the list, the description is a note for your team. Members with a blocked role trigger no custom command.

#Arguments

A command can take up to five arguments. The bot cuts the text behind the trigger at the separator, a , unless you pick another, and fills {argument.1}, {argument.2} and so on in that order. Whatever remains after the last cut stays in the last argument, separators included.

A command with the trigger .faction and two arguments receives the message .faction Harbour Crew, 12 members, led by Mara Lindt:

VariableValue
{argument.1}Harbour Crew
{argument.2}12 members, led by Mara Lindt

With a single argument nothing is cut: the whole text behind the trigger lands in {argument.1}. That lets your team pour any text into a prepared layout, for example .notice Restart at 20:00 for an announcement embed. An argument without text stays empty, and {argument.2?fb=not given} fills the gap.

#Follow-ups

Premium. A follow-up plans what happens after the command was used in a ticket. It waits for a reply and then runs its steps: one list for No reply, when the time is up, and one for Reply arrives, as soon as somebody answers. A command can have up to three follow-ups with up to five steps per list. You find them under Behaviour in the command editor.

  • Wait for a reply. A time such as 30m, 12h, 2d or 1h 30m, in English or German units. A number without a unit counts as minutes. Between one minute and 30 days.
  • Reply from. Whose message counts: the ticket owner, anyone, or the support team. The message that used the command never counts.
  • Steps. Close the ticket, send a message, DM the ticket owner, rename the ticket, send a custom command or delete the ticket. Texts take variables, including the arguments of the command.

Example: your team writes .waiting in a ticket. If the owner does not answer within 24 hours, the ticket closes. If an answer arrives, the ticket stays open and the bot confirms it in the channel.

ListSteps
No replyClose ticket, reason No reply within 24 hours.
Reply arrivesSend message Thanks, we will get back to you.

#Time from an argument

Put a variable into the wait, for example {argument.1}, and the member who uses the command picks the time: .waiting 2d. If the value is not a time, the bot says so in the channel and that follow-up does not start.

#Show the time

{followup.1}, {followup.2} and {followup.3} show in the reply when each follow-up runs, for example This ticket closes {followup.1} without a reply. Discord shows it as a relative time such as in 24 hours. Where no follow-up starts, outside a ticket or without Premium, they stay empty.

Follow-ups only run in open tickets. Using the command again starts them anew. Closing the ticket ends them, and so does the automation command with stop.