Functionalities
Other
$commandContainsAmount
Returns the number of times an existing command contains the content in the 2nd field. 3rd field indicates if the function will read everything case sensitive.
Some functions may break in this function. Try using the function name without the $ if this occurs.

FUNCTION USAGE

  • $commandContainsAmount[cmd;content]
  • $commandContainsAmount[cmd;content;sensitive]

Properties:

cmd - The command the function will be looking through. content - The content the function will be searching for in the command. sensitive - If true or yes, the function will look for the exact content with case sensitivity. If false or no, the function will look for the exact content without case sensitivity. Defaults to true.
Example 1: Returns 1 since one $channelType is used in the command.
1
bot.Command({
2
name: "test",
3
code: `
4
$channelType[$channelID]
5
6
$commandContainsAmount[$commandName;$channelType]
7
`
8
})
Copied!
Example 2: Returns 0 since no $channelType's are used in the command.
1
bot.Command({
2
name: "test",
3
code: `
4
$commandContainsAmount[$commandName;$channelType]
5
`
6
})
Copied!
Example 3: Returns 1 since one $channelType is used in the command and the 3rd field indicates the function will not read case sensitive.
1
bot.Command({
2
name: "test",
3
code: `
4
$channelType[$channelID]
5
6
$commandContainsAmount[$commandName;$channeltype;no]
7
`
8
})
Copied!
Last modified 8mo ago
Copy link
Contents
Properties: