Skip to content

$onlyIfMessageContains

$onlyIfMessageContains will check if the message contains the given text and if not return a error message.

Usage

$onlyIfMessageContains[content;...text;error]

Parameters

FieldTypeDescriptionRequired
contentstringMessage which should contain the given text.true
textstringText to check for in the message.true
errorstringError to return.true

Example(s)

This will return the error message as “aoi.js” does not appear in “Hello!“:

1
client.command({
2
name: "onlyIfMessageContains",
3
code: `
4
Ok.
5
$onlyIfMessageContains[Hello!;aoi.js;Couldn't find that word!]
6
`
7
});