FunctionsMember Functions
$hasAnyRole
Checks if a user has one of the given roles. Returns true or false.
Usage
$hasAnyRole[userID;roleID1;roleID2;...]- userID - (Optional) default value:
$authorID. If not included or left empty, $authorID will be used. - role N - You can add as many roles as needed.
Example
Using $hasAnyRole
How to use $hasAnyRole without user argument. Keep in mind that if the user does have only one of listed roles, true will be returned.
Member
9/5/2026
!!exec I have Admin OR Manager role: $hasAnyRole[admin;manager]
Custom Command
APP
9/5/2026
I have Admin OR Manager role: true
Member
9/5/2026
!!exec I have Admin role: $hasAnyRole[admin], I have Manager role: $hasAnyRole[manager]
Custom Command
APP
9/5/2026
I have Admin role: true, I have Manager role: false
Related Functions: $hasPerms $hasAnyPerm $hasRole
Function difficulty: Easy
Tags: roles management