// roles
Roles & menus
kesarAI gives members a self-service way to pick up roles and gives staff two enforcement tools that hold a role decision in place even when someone tries to undo it. Self-assignable role menus are an admin-built panel anyone can click; permanent roles and role bans are background watchers that re-apply or strip a role the moment it changes.
Overview
There are three independent systems on this page. Role menuslet members add and remove roles themselves from a button or dropdown panel — building them needs Discord Administrator. Permanent roles guarantee a member keeps a role: remove it and the bot puts it back. Role bans are the inverse: a member is blocked from ever holding a role, and if it is added the bot removes it.
The permanent-role and role-ban commands are notgated by Discord’s native permissions. They use kesarAI’s own per-role mod-permission grid — the perm_role permission for permanent roles and the roleban permission for role bans, both set with /modpanel. A single command, /permrolepersist, is bot-owner-only. See permission tiers for the full model.
All three systems honour Discord’s role hierarchy: the bot can only assign or remove roles below its own top role. A role above the bot cannot be put in a menu, made permanent, or enforced as a ban.
Self-assignable role menus
A role menu is a panel the bot posts to a channel. Members click a button or pick from a dropdown to toggle their own roles — no staff involvement after setup. The layout is chosen automatically: five roles or fewer render as buttons, six to twenty-five render as a dropdown. Each menu has a mode that decides how clicks behave:
- Toggle— click to add a role, click again to remove it.
- Exclusive— only one role from the menu at a time; picking a new one swaps out the old.
- Add only— members can grant themselves a role but cannot self-remove it.
Menus are built and managed through the /rolemenu command group, which is Administrator-only. Creating a menu opens an interactive setup panel where you select the roles, choose the mode, customise the title and description, and pick the channel to deploy to. Panels survive bot restarts, so the buttons keep working indefinitely. There is a limit of twenty-five menus per server.
Every self-assign and self-remove through a menu is written to the audit log under the Moderation category, as is creating, editing, or deleting a menu.
Permanent roles
A permanent role is one the bot guarantees a member keeps. If anyone — another bot, a moderator, or the member themselves — removes the role, kesarAI re-adds it almost immediately. The role is also re-applied automatically when the member rejoins the server, and a startup sync re-checks every tracked member after the bot restarts, so nothing is lost across a crash.
Removing a role from the permanent list does notremove the role from the member — it only stops the protection. A role cannot be both permanent and banned for the same member; the bot blocks the conflict and tells you which command to run first. Granting a permanent role also passes through anti-nuke clearance, so a non-whitelisted mod cannot launder a dangerous-permission role grant through it.
The permanent-role commands are gated by the perm_role mod permission. /permrolepersistis the exception: it is bot-owner-only and controls whether a server’s permanent-role and role-ban data is kept if the bot is removed from the server.
Role bans
A role ban blocks a specific member from ever holding a specific role. If the role is added to them by any means, the bot removes it right away. The same recovery paths as permanent roles apply: bans are re-checked when the bot restarts and enforced when the member rejoins.
Removing a role ban does notgrant the role — it only lifts the block. As with permanent roles, a role cannot be both banned and permanent for the same member at once. Role-ban commands are gated by the roleban mod permission.
Command reference
Role menus — the /rolemenu group, Administrator-only.
/rolemenu create— open the setup panel to build and deploy a new menu./rolemenu edit— re-open the setup panel for an existing menu by its message ID./rolemenu delete— delete a menu (and its message) by message ID./rolemenu list— list every role menu configured in this server.
Permanent roles — gated by the perm_role mod permission, except where noted.
/permrole— mark a role as permanent for a member./unpermrole— remove a role’s permanent protection (the member keeps the role)./permrolelist— paginated list of every permanent role in the server, with cleanup buttons./permrolecheck— show one member’s permanent roles and role bans, flagging any conflicts./permrolepersist— toggle whether this server’s data survives the bot leaving. Bot-owner-only.
Role bans — gated by the roleban mod permission.
/roleban— block a member from holding a role./unroleban— lift a role ban (does not grant the role)./rolebanlist— paginated list of every role ban in the server, with cleanup buttons.