$endsWith

Returns whether the provided text's last argument is 'query'.

Usage

$endsWith[text;query]

This function has two params.

ParamDescriptionTypeRequired

text

The text that may end with 'query'.

String

Yes

query

The word that 'text' may end with.

String

Yes

Remember the case of characters in `$endsWith[]` matters (e.g. `$endsWith[HELLO;o]` would return false). You can use [`$toLowerCase[]`](./tolowercase.md) to negate this issue.

Examples

Example #1

bot.commands.add({
    type: "basicCommand",
    name: "example",
    code: `$endsWith[Hello World;World]` //Returns true
})

Example #2

bot.commands.add({
    type: "basicCommand",
    name: "example",
    code: `$endsWith[Hello World;Hello]` //Returns false
})

Last updated