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

# Role Management

> Comprehensive role creation, editing, and assignment system

## Overview

The role management system provides powerful tools for creating, editing, and managing Discord roles. From simple role assignment to bulk operations and detailed customization, the r command handles all your role management needs.

<Info>
  All role commands support flexible syntax - you can specify roles by mention, ID, or name.
</Info>

***

## Commands

<AccordionGroup>
  <Accordion title="r (toggle role)" icon="toggle-on">
    Add or remove a role from a user.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~r <user> <role>
      ```

      ```bash Example theme={null}
      ~r @John Admin
      ~r @User 123456789
      ~r @Member Moderator
      ```
    </CodeGroup>

    **What It Does:**

    * If user has the role, removes it
    * If user does not have the role, adds it
    * Automatic toggle behavior

    **Permissions:** Manage Roles
  </Accordion>

  <Accordion title="r create" icon="plus">
    Create a new role with optional position and color.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~r create <name> [position] [color]
      ```

      ```bash Example theme={null}
      ~r create VIP
      ~r create Moderator 5
      ~r create Admin #ff0000
      ~r create Staff 10 #3498db
      ```
    </CodeGroup>

    **Parameters:**

    * **name** — Role name (required)
    * **position** — Role position in hierarchy (optional)
    * **color** — Hex code (optional)

    **Aliases:** `r c`\
    **Permissions:** Manage Roles
  </Accordion>

  <Accordion title="r delete" icon="trash">
    Delete a role by mention, ID, or name.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~r delete <role>
      ```

      ```bash Example theme={null}
      ~r delete @OldRole
      ~r delete 123456789
      ~r delete Inactive Role
      ```
    </CodeGroup>

    **What It Does:**

    * If multiple roles match, shows selection menu
    * Navigate with arrow buttons
    * Confirm deletion with Delete button

    **Aliases:** `r del`, `r d`\
    **Permissions:** Manage Roles
  </Accordion>

  <Accordion title="r edit" icon="pen-to-square">
    Update role name, color, and position interactively.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~r edit <role>
      ```

      ```bash Example theme={null}
      ~r edit @Admin
      ~r edit Moderator
      ~r edit 123456789
      ```
    </CodeGroup>

    **Interactive Prompts:**

    1. New Name? (reply "none" to skip)
    2. New Color? (reply "none" to skip)
    3. New Position? (reply "none" to skip)

    **Aliases:** `r update`, `r e`, `r u`\
    **Permissions:** Manage Roles
  </Accordion>

  <Accordion title="r color" icon="palette">
    Change a role's color. Supports solid colors, gradients, and holographic styling.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~r color <role> <color>
      ~r color <color> <role>
      ~r color <role> <color1> <color2>
      ~r color <role> holo
      ```

      ```bash Example theme={null}
      ~r color @Admin red
      ~r color blue Moderator
      ~r color @VIP #ff0000 #9b59b6
      ~r color @Staff holo
      ```
    </CodeGroup>

    **Color Modes:**

    * **Solid** — Single color name or hex code applied to the role
    * **Gradient** — Two colors create a gradient effect (requires Enhanced Role Styles)
    * **Holographic** — Special animated holographic style (requires Enhanced Role Styles)

    **Flexible Syntax:**

    * Role first: `r color @Admin red`
    * Color first: `r color red @Admin`

    **Color Formats:**

    * Color names: red, blue, purple, green, yellow, orange, pink, etc.
    * Hex codes: `#ff0000`, `3498db`, etc.

    **Aliases:** `r colour`\
    **Permissions:** Manage Roles

    <Note>
      Gradient and holographic modes require the server to have Enhanced Role Styles enabled.
    </Note>
  </Accordion>

  <Accordion title="r rename" icon="pen">
    Rename a role to a new name.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~r rename <role> <new_name>
      ~r rename <new_name> <role>
      ```

      ```bash Example theme={null}
      ~r rename @OldName NewName
      ~r rename SuperAdmin @Admin
      ~r rename HeadMod Moderator
      ```
    </CodeGroup>

    **Flexible Syntax:**

    * Role first: `r rename @OldName NewName`
    * Name first: `r rename NewName @OldName`

    **Aliases:** `r name`, `r rn`\
    **Permissions:** Manage Roles
  </Accordion>

  <Accordion title="r icon" icon="image">
    Set or remove a role icon from an emoji, URL, or image attachment.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~r icon <role> <emoji/url>
      ~r icon <emoji/url> <role>
      ~r icon remove <role>
      ```

      ```bash Example theme={null}
      ~r icon @Admin 👑
      ~r icon 🛡️ Moderator
      ~r icon @VIP https://example.com/icon.png
      ~r icon remove @Admin
      ```
    </CodeGroup>

    **Supported Input:**

    * Unicode emojis
    * Custom Discord emojis
    * Image URLs
    * Image attachments (attach an image directly to the message)

    **Flexible Syntax:**

    * Role first or icon first

    **Aliases:** `r i`\
    **Permissions:** Manage Roles
  </Accordion>

  <Accordion title="r info" icon="circle-info">
    Get detailed information about a role. You can also pass a user mention or ID to view their highest role.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~r info <role>
      ~r info <user>
      ```

      ```bash Example theme={null}
      ~r info @Admin
      ~r info Moderator
      ~r info 123456789
      ~r info @John
      ```
    </CodeGroup>

    **Information Shown:**

    * Role name and ID
    * Member count
    * Position in hierarchy
    * Color (including gradient and holographic display)
    * Mentionable status
    * Hoisted status
    * Managed status
    * Creation date
    * Permissions list

    **Aliases:** `r information`\
    **Permissions:** None (view only)
  </Accordion>

  <Accordion title="r humans" icon="users">
    Add or remove a role from all human users.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~r humans <role>
      ```

      ```bash Example theme={null}
      ~r humans @Members
      ~r humans Verified
      ~r humans Community
      ```
    </CodeGroup>

    **Smart Toggle:**

    * If more than 50% of humans have the role, removes from all
    * If less than 50% of humans have the role, adds to all

    **Process:**

    * Shows progress message
    * Processes approximately 10 members per second
    * Reports success and failure count

    **Aliases:** `r human`\
    **Permissions:** Manage Roles

    <Warning>
      This is a bulk operation and may take time for large servers.
    </Warning>
  </Accordion>

  <Accordion title="r bots" icon="robot">
    Add or remove a role from all bots.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~r bots <role>
      ```

      ```bash Example theme={null}
      ~r bots @Bot
      ~r bots Utility Bots
      ~r bots Music Bots
      ```
    </CodeGroup>

    **Smart Toggle:**

    * If more than 50% of bots have the role, removes from all
    * If less than 50% of bots have the role, adds to all

    **Process:**

    * Shows progress message
    * Processes approximately 10 bots per second
    * Reports success and failure count

    **Aliases:** `r bot`\
    **Permissions:** Manage Roles
  </Accordion>
</AccordionGroup>

***

## Role Finding

The system intelligently finds roles using multiple methods:

1. **Mention** — Most reliable method
2. **ID** — Use the role's unique ID
3. **Exact Name** — Case-insensitive exact match
4. **Partial Name** — If only one role contains the text

<Note>
  If multiple roles match, you'll get a selection menu to choose the correct one.
</Note>

***

## Permission Requirements

<CardGroup cols={2}>
  <Card title="Bot Permissions" icon="robot">
    The bot needs:

    * Manage Roles
    * Bot's role must be higher than roles it manages
  </Card>

  <Card title="User Permissions" icon="user">
    Command Requirements:

    * **Manage Roles** — For most commands
    * Your highest role must be above the role you're managing
    * Server owner bypasses hierarchy checks
  </Card>
</CardGroup>

***

## Aliases

The role command has a short and convenient alias:

<Card title="r" icon="r">
  Main alias for all role commands
</Card>

***

## Usage Examples

<Tabs>
  <Tab title="Basic Operations">
    ```bash theme={null}
    # Toggle role on or off for a user
    ~r @John Member
    ~r @User VIP

    # Create a simple role
    ~r create Supporter

    # Delete a role
    ~r delete @OldRole

    # Get role info
    ~r info @Admin
    ```
  </Tab>

  <Tab title="Role Creation">
    ```bash theme={null}
    # Basic role
    ~r create Member

    # Role with color
    ~r create VIP #ff69b4
    ~r create Donator #e91e8c

    # Role with position
    ~r create Moderator 5

    # Role with both
    ~r create Admin 10 #ff0000
    ```
  </Tab>

  <Tab title="Customization">
    ```bash theme={null}
    # Solid color
    ~r color @Admin blue
    ~r color green Moderator

    # Gradient color
    ~r color @VIP #ff0000 #9b59b6

    # Holographic
    ~r color @Staff holo

    # Rename role
    ~r rename @OldName NewName

    # Set icon
    ~r icon @Admin 👑
    ~r icon 🛡️ Moderator

    # Remove icon
    ~r icon remove @Admin

    # Edit everything interactively
    ~r edit @Admin
    ```
  </Tab>

  <Tab title="Bulk Operations">
    ```bash theme={null}
    # Give role to all humans
    ~r humans @Members

    # Give role to all bots
    ~r bots @Bot

    # Remove role from all humans
    ~r humans @Temporary

    # Remove role from all bots
    ~r bots @Testing
    ```
  </Tab>

  <Tab title="Advanced">
    ```bash theme={null}
    # Multiple ways to specify roles
    ~r info @Admin
    ~r info 123456789
    ~r info Admin

    # Get info via user mention
    ~r info @John

    # Flexible color syntax
    ~r color red @Admin
    ~r color @Admin red

    # Flexible rename syntax
    ~r rename NewName @OldName
    ~r rename @OldName NewName

    # Flexible icon syntax
    ~r icon 👑 @Admin
    ~r icon @Admin 👑

    # Icon via attachment
    # (attach image to the message)
    ~r icon @Admin
    ```
  </Tab>
</Tabs>

***

## Related Features

<CardGroup cols={2}>
  <Card title="Autorole" icon="user-tag" href="/autorole">
    Automatically assign roles to new members
  </Card>

  <Card title="Server Settings" icon="server" href="/server">
    Manage other aspects of your server configuration
  </Card>
</CardGroup>
