> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zynrax.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Mainrole

> Protect your important & family roles from unauthorized mentions with an instant-ban security system.

The **Mainrole** system is a high-security defense layer designed to protect your most important roles (like `@Admin`, `@Moderator`, or your server's **Family** roles) from being mentioned by unauthorized users.

Unlike the threshold-based Anti-Nuke system, Mainrole takes **instant action** — the moment a non-authorized user mentions a protected role, they are immediately banned from the server.

## Features

* **Instant Protection**: No thresholds or limits. One mention of a family or admin role equals an instant ban.
* **Multiple Protections**: Protect up to **5** different roles at once.
* **Owner-Only Config**: Only the Server Owner or designated Extra Owners can manage these settings.

## Getting Started

To begin protecting your roles, you can use the `mainrole add` command.

<CodeGroup>
  ```bash Syntax theme={null}
  ,mainrole add (role)
  ```

  ```bash Example theme={null}
  ,mainrole add @Family
  ```
</CodeGroup>

<Frame>
  <img className="rounded-xl" src="https://mintcdn.com/zynraxdevelopment-9bbc81fc/wDzxParB8NBY4q1h/images/mainrole.png?fit=max&auto=format&n=wDzxParB8NBY4q1h&q=85&s=4f0019488a0bf35df0757240f131ff5b" width="526" height="218" data-path="images/mainrole.png" />
</Frame>

### Removing Roles

If you no longer wish to protect a specific role, you can remove it from the configuration.

<CodeGroup>
  ```bash Syntax theme={null}
  ,mainrole remove (role)
  ```

  ```bash Example theme={null}
  ,mainrole remove @Family
  ```
</CodeGroup>

<Frame>
  <img className="rounded-xl" src="https://mintcdn.com/zynraxdevelopment-9bbc81fc/wDzxParB8NBY4q1h/images/mainroleremove.png?fit=max&auto=format&n=wDzxParB8NBY4q1h&q=85&s=ebdb44903df37cccd7e7aa4df7e91717" width="513" height="236" data-path="images/mainroleremove.png" />
</Frame>

<Info>
  Once a role is added to the Mainrole configuration, Zynrax will actively monitor every message for mentions of that role.
</Info>

## Configuration Commands

Manage your protected role list with these simple commands.

### Viewing Protected Roles

See exactly which roles are currently under Zynrax's instant-ban protection.

<CodeGroup>
  ```bash Syntax theme={null}
  ,mainrole list
  ```
</CodeGroup>

<Frame>
  <img className="rounded-xl" src="https://mintcdn.com/zynraxdevelopment-9bbc81fc/wDzxParB8NBY4q1h/images/mainrolelist.png?fit=max&auto=format&n=wDzxParB8NBY4q1h&q=85&s=53dd1c76198fce85adef017d0b5a69a0" width="488" height="210" data-path="images/mainrolelist.png" />
</Frame>

### Disabling the Module

If you need to disable role protection entirely, you can reset the configuration.

<CodeGroup>
  ```bash Syntax theme={null}
  ,mainrole reset
  ```
</CodeGroup>

<Frame>
  <img className="rounded-xl" src="https://mintcdn.com/zynraxdevelopment-9bbc81fc/wDzxParB8NBY4q1h/images/mainrolereset.png?fit=max&auto=format&n=wDzxParB8NBY4q1h&q=85&s=bb8452ea2eca24a0325a4674453be115" width="490" height="218" data-path="images/mainrolereset.png" />
</Frame>

<Warning>
  After a `reset`, none of your roles will be protected. Any user will be able to mention them without being banned by Zynrax.
</Warning>

## Whitelisting Users

If you want a specific user to be able to mention protected roles without being banned, you must add them to the security whitelist.

<CodeGroup>
  ```bash Syntax theme={null}
  ,whitelist (user)
  ```

  ```bash Example theme={null}
  ,whitelist @Montage
  ```
</CodeGroup>

<Frame>
  <img className="rounded-xl" src="https://mintcdn.com/zynraxdevelopment-9bbc81fc/wDzxParB8NBY4q1h/images/mainrolewl.png?fit=max&auto=format&n=wDzxParB8NBY4q1h&q=85&s=abb4688b86fdc1aa4bb1358aeade15cb" width="531" height="692" data-path="images/mainrolewl.png" />
</Frame>

<Warning>
  Whitelisting a user gives them total immunity from the Mainrole system. Only whitelist users you trust completely.
</Warning>

## Authorized Users

To prevent accidental bans of your own team, the following users are automatically exempt from Mainrole protection:

* **Server Owner**: Always allowed to mention any role.
* **Extra Owners**: Users who have been added to the `extraowner` list and have Administrator permissions.
* **Whitelisted Users**: Users who are on the general security whitelist.

<Tip>
  Ensure your moderators are added to the **whitelist** if you want them to be able to mention protected roles during audits or announcements.
</Tip>
