Custom Command
FunctionsMember Functions

$hasRoles

Checks if user has all of the given roles. Returns true or false.

Usage:

$hasRoles[userID;role1;role2;...]
  1. userID - User you want to check for roles.
  2. role N - You can add as many roles as needed.

Example

Using $hasRoles

How to use $hasRoles. Keep in mind that only if the user does have all of listed roles, true will be returned.

Member
9/5/2026

!!exec $hasRoles[$authorID;123456789123456789]

Custom Command
APP
9/5/2026

true

Suggestion

To make code stop if the user doesn't have the needed role, you can check out $onlyIf. For multiple actions, check $if.

Related Functions: $hasAnyPerm $hasPerms $hasAnyRole

Function difficulty: Easy

Tags: roles management

On this page