This is a guide on how custom commands work, what you can do with them and how to create them. If you have suggestions or examples you think should be added to this guide, see #suggestions in Bender's Lair.
The dashboard doesn't currently support custom commands. For the time being, you'll have to create them using the commands in the guide below.
There are a few ways in which Bender's custom commands differ from other bots:
;cc params
) which allows for both required and optional arguments with - Each of the parameters as mentioned above can be formatted into an ID, mention, user tag, etc. in responses or passed to other commands/actions.;fullstats
command which shows the output of both ;stats
and ;serverinfo
in a single response message.To create a custom command, use ;cc create <name>
. For example, ;cc create fullstats
.
To create an auto-responder, use ;cc create responder <regex>
. For example, ;cc create responder ^no u
will respond to all messages starting with "no u". To try out regular expressions (regex), see Regexr.
To view a list of all custom commands on the server, use ;cc list. For details about a specific custom command, use ;cc <name>
or ;help <name>
, i.e. ;help fullstats
.
For auto-responders, you need to find the auto-responder number in ;cc list
and use ;cc <number>
, i.e. ;cc 1
for auto-responder #1. ;help <number>
won't work for auto-responders.
There are three types of actions you can add: say, wait, and commands. Over 170 commands are available as custom command actions; see the Available Actions page ;help all
for a full list on what can and can't be used.
To add an action to a custom command, use ;cc add <name> <action> [additional arguments]
. For example, ;cc add fullstats stats
or ;cc add fullstats info server
.
To add an action to an auto-responder, use ;cc list
to find the number of the auto-responder and use that number in place of a name. For example, for responder #2, you would use ;cc add 2 say You just swore in my Christian server!
.
The wait action simply waits a certain number of seconds (between 1 and 60) before continuing to the next action. To add one, use ;cc add <name> wait <seconds>
. For example, ;cc add slowbot wait 36
.
The say action has a couple special features regarding the channel the message is sent to. To send to a static channel every time, use ;cc add <name> say <channel> <text>
. For example, ;cc add staff-suggestion say #private-suggestions A user has a suggestion...
.
To send to a dynamic channel (which is found using the first argument to the command), use [destination]
instead of a channel name. For example, in a custom command called talk
, you could add ;cc add talk say [destination] {1...}
. Using ;talk #staff A message for the mods...
, the message will be sent to #staff, but the text "#staff" won't be included.
Unlike a static channel, [destination]
will fail the command if the user specifies a channel they don't have access to. If no channel is specified for [destination]
, the action will be skipped. To prevent this, use a required channel parameter (see the parameters section.)
Normal users can only add one say action per custom command/auto-responder. If you have Bender Pro, this limit is increased to 10, allowing you to send different responses to different channels or split a response into multiple messages in the same channel.
Arguments for custom command actions can also include variables such as {1}
or {prev}
- see the variables section.
Some commands, including all from the Image Tools and Memes groups, can only be used once per custom command.
See the Available Actions page for details on these limits.
Actions can be edited in a very similar way as they were added - ;cc replace
works the same way as ;cc add
with an extra argument for the action number. For example, to change the 3rd action of a custom command called bigban
, you could use ;cc replace bigban 3 say #logs New message here
.
When replacing an auto-responder action, make sure you use the numbers in the correct order! Mistaking
;cc replace 1 3 ...
with;cc replace 3 1 ...
could accidentally break your other responders.
Restrict usage of a custom command or auto-responder to a certain list of roles, Discord permission, or specified role and above (just like using ;perms
with a regular command.).
To set permissions for a custom command, use ;cc perms <name> <permission>
. For example, ;cc perms fullstats chat-mod+
or for an auto-responder, ;cc perms 1 kick_members
.
When a user doesn't have perms to use a custom command, a "You don't have permission..." message is sent if ;config perm-msgs
is enabled. When a user doesn't have perms to use an auto-responder (or ;config perm-msgs
is disabled), it's simply ignored and has no response.
To restrict a custom command to certain channels or prevent it from being used in others, you can used a whitelist or blacklist respectively.
These options (;cc whitelist
and ;cc blacklist
) are mutually exclusive; you can have one or the other (or neither) but not both.
To create a whitelist, use ;cc whitelist <name> <channels>
, with <channels>
being a list of channels separated by |
. For example, ;cc whitelist fullstats #commands | #spam | #shitposting
.
;cc blacklist
works the same way; an example using an auto-responder is ;cc blacklist 1 #staff | #staff-commands | #rules
.
Parameters are used to tell Bender how to parse the command input into channels, roles, etc. for use in actions.
They can only be used in custom commands, not auto-responders.
Use required parameters (<role>
, <channel>
, <user>
, <member>
) to force proper usage of your command, failing if it isn't found.
Use optional parameters ([role]
, [channel]
, [user]
, [member]
) to parse roles, channels, etc. in a more flexible way, still functioning if they're omitted or can't be resolved.
To add parameters to a custom command, use ;cc params <name> <parameter set>
; for example, ;cc params gibrole <member> <role>
.
Required and optional arguments can be mixed or matched; for example, <role> [user] <channel>
would be a valid parameter set. However, we recommend putting all required arguments first (i.e. <role> <channel> [user]
) to avoid confusion and ambiguity.
Variables are very important for creating most custom commands - they let you use different kinds of text and values in actions.
They can be used in both responses (say actions) and in arguments to other actions. For example, in ;cc add bigtag mentionable {1.mention}
, the parsed role mention of the 1st argument is passed to ;mentionable
, ensuring that it uses the same role as other actions.
{prev}
- Result from the previous action, i.e. 🏓 API Latency: 69ms
{args}
- The arguments from the original command, or all of a responder message.{p}
- The current bot prefix.{server}
- The name of the current server. You can also use guild
for this and the following variables.{server.id}
- ID of the server.{server.members}
- Number of members in the server.{server.region}
- Formatted region of the server, i.e. 🇺🇸 US (South)
{server.region_id}
- Unformatted region of the server, i.e. us-south
{server.icon}
- URL of the server icon, if one is set.{server.owner}
- Mentions (pings) the server owner.{server.owner.tag}
- The owner's Discord tag, i.e. Bender#2282
{server.owner.discrim}
- The owner's discrim, i.e. 2282
{server.owner.id}
- The owner's ID, i.e. 300800171988484096
{server.owner.avatar}
- The owner's avatar URL, if they have one.{author}
- Mentions the user that sent the original command.{author.tag}
, {author.discrim}
, {author.id}
, {author.avatar}
, {author.name}
, {author.color}
{channel}
- Clickable name of the channel in which the original command was used.{channel.name}
, {channel.id}
- Unclickable (text) name and ID of the channel, respectively.These can only be used in custom commands, not auto-responders.
{#}
(i.e. {1}
, {2}
) - An unformatted argument from the original command, from 1 to 9.{#...}
(i.e. {2...}
) - Includes an argument (like above) and all text after it.{...#}
(i.e. {...3}
) - Includes an argument and all text before it.{#...#}
(i.e. {2...8}
) - A range of arguments (inclusive.)If one of these arguments was added as a user, member, role, or channel using ;cc params
, it can also be formatted using the following options:
These can only be used in custom commands, not auto-responders.
{#.mention}
- Clickable user, member, role, or channel mention. This will ping users if Bender has the proper permissions.{#.id}
- User, member role, or channel ID, i.e. 300800171988484096{#.name}
- User, member (nickname or username), role, or channel name, i.e. general{#.color}
- Member or role color, i.e. #FF0000{#.members}
- Role member count, i.e. 24{#.tag}
- User or member tag, i.e. Mark.#9999{#.discrim}
- User or member discriminator, i.e. 9999{#.avatar}
- User or member avatar URL, if they have one.To enable or disable your custom command, use ;cc enable <name>
or ;cc disable <name>
respectively. For example, ;cc enable bigban
. As with other subcommands, replace the name with a number for auto-responders.
Before enabling a custom command, make sure it's set up properly; if it includes sensitive actions that normal members shouldn't have access to, set permissions for the command first! Custom command actions bypass Bender's regular permissions system, so it's very important that you configure them properly, especially when using potentially destructive commands such as
;del
.
To remove an action from a custom command, use ;cc delete <name> <action number>
or ;cc remove <name> <action number>
. For example, ;cc remove bigban 1
.
To delete an entire custom command, use ;cc delete <name>
or ;cc remove <name>
. For example, ;cc delete bigban
.
As with other subcommands, replace the name with a number for auto-responders.
Be careful using this subcommand as well - if you forget a number or put something in the wrong order, you might accidentally delete the whole command or the wrong action.