Functionalities
Other
$indexOfTextSplit
Returns the index value of the content in `$textSplit`. Returns `undefined` if an index doesn't match.

FUNCTION USAGE

  • $indexOfTextSplit[value]

Properties:

value - The text value to match in the $textSplit.

Example 1: Returns 1 because the word test is in the 1st field of $textSplit.

1
bot.Command({
2
name: "test",
3
code: `
4
$indexOfTextSplit[test]
5
$textSplit[test-bro;-]
6
`
7
})
Copied!

Example 2: Returns 2 because the word bro is in the 2nd field of $textSplit.

1
bot.Command({
2
name: "test",
3
code: `
4
$indexOfTextSplit[bro]
5
$textSplit[test-bro;-]
6
`
7
})
Copied!

Example 3: Returns undefined because the word tacky is not in the $textSplit.

1
bot.Command({
2
name: "test",
3
code: `
4
$indexOfTextSplit[tacky]
5
$textSplit[test-bro;-]
6
`
7
})
Copied!
Last modified 4mo ago
Copy link
Contents
Properties: