$enabled
Allows you to enable or disable a command by defining the 1st field either `yes` or `no`. The 2nd field contains the error message if the 1st field is set to 'no'. 2nd field is optional.

FUNCTION USAGE

  • $enabled[yes]
  • $enabled[no]
  • $enabled[yes;error]
  • $enabled[no;error]

Properties:

yes - The command will execute as intended. no - The command will not execute. If an error message is defined in the 2nd field, the error will be sent to the channel. error - The error message if the 1st field is defined as no..

Example 1: Code will not execute and the error message will be sent to the channel instead.
1
bot.Command({
2
name: "test",
3
code: `
4
code goes here XD have fun
5
6
$enabled[no;This command is disabled and will show this error message.]
7
`})
Copied!
Example 2: Code will not execute and since no error message is defined, nothing will happen.
1
bot.Command({
2
name: "test",
3
code: `
4
code goes here XD have fun
5
6
$enabled[no]
7
`})
Copied!
Example 3: The code will execute as intended.
1
bot.Command({
2
name: "test",
3
code: `
4
code goes here XD have fun
5
6
$enabled[yes]
7
`})
Copied!
Last modified 4mo ago
Copy link
Contents
Properties: