Role Locker Commands
Protect key roles from manual or unauthorized removal from members.
Overview
The Role Locker system allows server administrators to secure specific roles. Once a role is added to the locker list, any manual removal of that role by a user (e.g. from the Discord member list) will be automatically intercepted, blocked, and reverted by Raptor. The role is instantly restored, and an alert is logged to the server's mod logs.
Core Settings Integration
To bypass the lock and safely remove a locked role from a member, authorized moderators/admins must use the new /removerole slash command.
rolelocker add
Adds a role to the Role Locker list.
Usage:
/rolelocker add [role]
Example:
/rolelocker add @Verified
Requirements:
- Bot must have
Manage Rolespermission. - Bot's highest role must be above the role you are adding.
Permissions Required: Configured Admin role.
rolelocker remove
Removes a role from the Role Locker list.
Usage:
/rolelocker remove [role]
Example:
/rolelocker remove @Verified
Effect:
- The role is no longer protected and can be freely assigned or removed manually by standard Discord role editors.
Permissions Required: Configured Admin role.
rolelocker list
Lists all roles currently protected by the Role Locker.
Usage:
/rolelocker list
Permissions Required: Moderator or higher.
addrole
Safely assigns a locked role to a member, bypassing the Role Locker assignment block.
Usage:
/addrole [member] [role] [optional: reason]
Example:
/addrole @Wumpus @Verified Good behavior
Permissions Required: Configured Moderator/Admin, or specifically whitelisted users/roles in the locked role configuration.
removerole
Safely removes a locked role from a member, bypassing the Role Locker block.
Usage:
/removerole [member] [role] [optional: reason]
Example:
/removerole Wumpus @Verified Suspended for rules violation
Permissions Required: Configured Moderator/Admin, or specifically whitelisted users/roles in the locked role configuration.
How It Works
- Role Modification Interception: When a member's roles are updated, Raptor checks if any added or removed role is on the Role Locker list.
- Bypass Verification: Raptor checks if a bypass flag is active in Redis (meaning the action was initiated via
/addroleor/removerole) or if the audit logs show the action was performed by Raptor itself. - Reversion & Alerting: If no bypass is found (e.g., a moderator or admin manually assigns or removes the role via the Discord native UI), Raptor instantly reverts the action (removes the role if added, or restores it if removed) and logs a
🔒 Role Locker Enforcedwarning in the mod logs channel. - Granular Permissions & Whitelisting: Through the Web Dashboard, administrators can configure specific bypass whitelists for each locked role, specifying whether admins/mods only can manage them, as well as listing specific roles or user IDs allowed to bypass. The server owner and the user who initially set up the locker are permanently whitelisted for full bypass access.
Web Dashboard Management
You can also manage these settings visually:
- Go to your Web Dashboard.
- Navigate to Core Settings.
- Look for the Role Locker Configuration section (indicated by the red lock icon).
- You can view, add, and remove protected roles, edit their whitelists, and save modifications directly from the interface.