In this page, you will learn about the custom command interface YAGPDB provides on its dashboard.
To make a custom command, we'll follow a set of easy steps (which really are quite simple).
Go to the dashboard, log in, and select your server.
On the sidebar, there are several sections, but the one we're interested in is the Core section. Click that.
In the menu that pops up, click Custom commands.
Congratulations! You're at the custom commands interface of YAGPDB. When we start creating more and more custom commands, they will be shown here with line numbers and syntax highlighting.
If you want to go ahead and create your first custom command, click Create a new Custom Command. You'll be greeted with an interface which has several different options - the trigger and trigger type (which will be covered later) and restrictions, but what we're interested in is the Response. If you want to take a detour and create your very first custom command, you'll want to read the page Outputs 1
.
Custom Command Options
Other than the Response
or code of the custom command, there are several other options available. We'll go over these one by one.
When you create a new custom command, the above is what you will be seeing (or something close to it). We'll be going over all the options available. If you are more of a visual learner, the options are numbered on the image. The numbers correspond to:
Response - The response / code of the custom command.
Trigger - What triggers the custom command.
Trigger type - See below.
Channel/Role restrictions - Ignore / allow roles / channels to use the command.
Custom command group - Custom command group the command belongs to.
Trigger Type
The trigger type is the type of trigger you want to use. By default, this is Command
. All the available types are listed below in no particular order:
None
Type : This is a trigger type with which the custom command cannot be triggered from within discord directly and can only be triggered manually or from within another custom command. \Command
Type: This is the one that you'll likely be using for a lot of your own custom commands, as it's the same as a built-in command. It can be executed with either the prefix set for your server, or by mentioning YAGPDB with the command name. If the command name isfoobar
, we could execute it either by typing@YAGPDB.xyz foobar
or-foobar
. Note: with theCommand
trigger type, you do not have to add the prefix at the start of your trigger - if the command is namedfoobar
, the trigger would be justfoobar
, not-foobar
.\Starts With
Type: This one is rather self explanatory. Anything that starts with the trigger will trigger this custom command. For example, if our trigger ishello
,hello YAGPDB
would trigger our command butYAGPDB, hello!
would not.\Contains
Type: This type is also quite self explanatory. Anything that contains the trigger will trigger this custom command. For example, if our trigger ishello
, bothHello YAGPDB
andYAGPDB, hello!
would trigger our command.\Regex
Type: Anything that matches the trigger as a regex will execute this custom command. For example, if we had the trigger\bhey\b
,hey there YAGPDB
would trigger the custom command butheya YAGPDB
would not. Using Regex is covered in the documentation, so we will leave it at that.\Exact Match
Type: Anything that matches the trigger (not case sensitive) will trigger this custom command. Let's take the example of a custom command with the triggertest
. Bothtest
andTEST
would trigger the custom command, whiletest YAGPDB
would not.\Reaction
Type: A special type of custom command that triggers only on reactions. When this trigger type is used, the.
has an additional property calledReaction
, which is documented here. When using this, instead of the trigger, you can see 3 other options which areAdded + Removed reactions
,Added reactions only
, andRemoved reactions only
. By default, it isAdded + Removed reactions
which will trigger on all reactions. We will talk more about this in a later chapter.\Hourly
andMinute
interval: This custom command is ran on an interval in a given channel. You may optionally ignore specific hours and weekdays. Channel selection must be present for this trigger to work.
Hopefully, after reading this, you have a good understanding of what the trigger type is and what trigger type you wish to use for your custom command.
Restrictions
When using specific types of custom command, you will be able to set restrictions on who is able to trigger your custom command. You can ignore / only run in specific channels and ignore / only run for specific roles.
A common mistake that users make is to either set the required roles to require no roles or require no channel. If you want the restrictions to be none, you must set the restriction on ignore (channels / roles) rather than require (channels / roles), otherwise, it will not respond.
You can take advantage of this if you want to disable a command, but in many cases users do this by accident and are unable to use their CC for apparently no reason.
Custom Command Group
When you have more custom commands, you may want to group them. This is when the Custom command group
option comes in. After you make a group, it will be available as a group. All commands are ungrouped by default.
Tip: After writing your custom command, you can either Save
or Delete
it. Note that for a custom command to update, you have to press Save
.