The bot will only trigger commands, when it can see the channel, the command is used!
Make sure the bot has permissions to view the channel you use for the command. And make sure "Send Messages" is enabled!
This syntax is unique to our bot! It is the most commonly used form in word triggers!
!test -> The bot will trigger when a message is EXACTLY the same as
Trigger with Arguments
!test -> The bot will trigger when a message starts with
!test and the code includes
Trigger not Case Sensitive
!test|i -> The bot will trigger when a message starts with
(The capitalization doesn't matter in the case!)
Arguments are really helpful, when you want the executer of the command to put in extra data!
If you want to use arguments,your code must use $message or $mentioned
Refering to arguments in codes
To get the data inputted as arguments, you use the function
$message-> to return all the arguments
$message[x]-> to return a specific argument! (replace the
xwith a valid number!)
Arguments are saved in an array, so
$message would output the first argument,
$message the second one, enz...
Arguments get splited on whitespace!
!say hi hello would get splitted at in between
The first argument would be
hi in this case and the second
REGEX is a way to let a command trigger on multiple words/ triggers!
We highly suggest, you learn REGEX, if you're going to use it yourself!
Below are a couple of examples:
Multiple command prefixes
/^(!|>|\?|\.)help/gi -> This will trigger when the 1 of the following messages is send:
!help >help ?help .help
/^(!help|!h|!info)/gi -> This will trigger when the 1 of the following messages is send:
!help !h !info
/^(!|>|\?|\.)(help|h|info)/gi -> This will trigger when the 1 of the following messages is send:
!help !h !info
>help >h >info
?help ?h ?info
.help .h .info
Do you want to know more, about the bot's syntax? You can check out this page to learn more!