Functionalities
Other
$commandError
If the command has an error defined in the command header, bot will return the error message. If no error is defined, bot will return `undefined`.

FUNCTION USAGE

  • $commandError
  • $commandError[]
  • $commandError[commandName]

Properties:

[] - Returns the error of the current command. Same as no brackets. commandName - Define a command name to return the command's error message.

Example 1: Function will return: "A very disabled command".

1
bot.Command({
2
name: "ping",
3
status: "enabled",
4
error: "A very disabled command",
5
code: `
6
$commandError
7
`
8
})
Copied!

Example 2: Function will return: "A very disabled command".

1
bot.Command({
2
name: "test1",
3
status: "enabled",
4
code: `
5
$commandError[ping]
6
`
7
})
Copied!

Example 3: Function will return "undefined" since the command "test1" does not have an error defined in the command.

1
bot.Command({
2
name: "test2",
3
status: enabled,
4
code: `
5
$commandError[test1]
6
`
7
})
Copied!
Last modified 10mo ago
Copy link
Contents
Properties: