Moderation
checkUserPerms
$checkUserPerms
Checks if a user has all the specified permissions. Alias of $hasPerms. Returns "true" or "false".
Syntax
$checkUserPerms[userID;permission1;permission2;...]
$checkUserPerms
The $checkUserPerms function checks if a user has all the specified Discord permissions. This is a direct alias of $hasPerms — the two functions are strictly identical.
Syntax
$checkUserPerms[userID;permission1;permission2;...]
Parameters
| Parameter | Type | Description |
|---|---|---|
userID |
Snowflake | The ID of the user to check. |
permission1;permission2;... |
String[] | Required permissions (checks with AND). |
Return value
- Type: String
"true"or"false" "true": The user has all permissions."false": At least one permission is missing.
Behavior
- Inline check: Does not interrupt the command.
- AND check: All listed permissions are required.
Administratorcovers all permissions.
Examples
Inline verification
$if[$checkUserPerms[$authorID;KickMembers]==true]
$kick[$mentioned[1]]
$else
$sendMessage[❌ KickMembers permission required.]
$endif
Checking another user’s permissions
$if[$checkUserPerms[$mentioned[1];Administrator]==true]
$sendMessage[⚠️ You cannot perform this action on an administrator.]
$stop
$endif
$ban[$mentioned[1]]
Multi-permissions
$if[$checkUserPerms[$authorID;ManageMessages;ReadMessageHistory]==true]
$clear[50]
$else
$sendMessage[❌ Insufficient permissions.]
$endif
Notes
$checkUserPermsand$hasPermsare interchangeable. Use whichever syntax is most explicit for your context.- For the bot itself, pass
$botIDas theuserID. - For a check with automatic interruption (guard), use
$onlyPerms. - Permissions are in PascalCase:
BanMembers,ManageMessages,Administrator, etc.