Functionalities
Other
$charCount
Counts how many characters are in the command message or the characters within the brackets and returns the number (includes spaces).

FUNCTION USAGE

  • $charCount
  • $charCount[]
  • $charCount[content]

Properties:

[] - Bot will return the number of characters provided in the entire command. Same as no brackets. content - Bot will return the number of characters within the brackets.

Example 1: Returns the number of characters provided in the command.

1
bot.Command({
2
name: "say",
3
code: `
4
$message[]
5
$onlyIf[$charCount>=15;You command must contain more than 15 characters to be worth anything.]
6
`
7
})
8
// With this limiter in place using $charCount, command will only execute if more than 15 characters are provided.
Copied!

Example 2: Returns the number of characters in the 3rd word.

1
bot.Command({
2
name: "say",
3
code: `
4
$message[]
5
$onlyIf[$charCount[$message[3]]>=5;The 3rd word must be at least 5 characters long]
6
`
7
})
Copied!
Last modified 11mo ago
Copy link
Contents
Properties: