Skip to content

$onlyForRoles

$onlyForRoles will check if the user who executed the command has any of the listed roles and return a error message if not.

Usage

$onlyForRoles[...roleIds;error]

Parameters

FieldTypeDescriptionRequired
…roleIdsstring, numberRoles you want to limit the command to.true
errorstringError to return when the command was not executed by any user with the listed roles.false

Example(s)

This will limit the command only to the listed roles:

1
client.command({
2
name: "onlyForRoles",
3
code: `
4
Ok.
5
$onlyForRoles[roleID;roleID;You can't use that command!]
6
`
7
});