Moderation
blacklistRoles
$blacklistRoles
Guard function that blacklists roles. If the user has any of the roles, the command is interrupted.
Syntax
$blacklistRoles[roleID1;roleID2;...;(errorMessage)]
$blacklistRoles
The guard function $blacklistRoles blocks the execution of the command if the user has at least one of the blacklisted roles.
Syntax
$blacklistRoles[roleID1;roleID2;...;(errorMessage)]
Parameters
| Parameter | Type | Description |
|---|---|---|
roleID1;roleID2;... |
Snowflake[] | IDs of roles to blacklist, separated by ;. |
errorMessage |
String (optional) | Message sent if the user has a blacklisted role. |
Behavior
- Checks if the user has any of the roles in the list.
- If at least one role matches, the command is interrupted.
- Checked using an OR condition (a single blacklisted role is enough to block).
- If an error message is provided, it is sent; otherwise, it remains silent.
Examples
Block muted users
$blacklistRoles[123456789012345678;❌ You are currently muted. Contact a moderator.]
$sendMessage[Your message has been processed.]
Multiple blacklisted roles
$blacklistRoles[111111111111111111;222222222222222222;❌ Access forbidden for your role.]
$clear[10]
$sendMessage[10 messages deleted.]
Silent blacklist
$blacklistRoles[123456789012345678]
$sendMessage[Command executed.]
Notes
$blacklistRolesand$blacklistRoleIDsare interchangeable.- To whitelist roles, use
$onlyForRoles. - Very useful to prevent muted or restricted users from using commands.
- Combine it with
$blacklistUsersfor complete protection (specific roles + users).