# Edit Role

<figure><img src="/files/kvg1orsUz5UIIWLt9dlL" alt=""><figcaption></figcaption></figure>

The Edit a role block will edit a role in your server. Editing can modify different aspects of an already existing role. Some fields can be left blank for no changes to occur.

## Role

This selection will specify the method of targeting the role that will be edited.

<figure><img src="/files/y8rr0Pygbi6YRTOWIRTX" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="Role Option" %}
This selection will target a [role option](/custom-commands-and-events/options/role-option.md) which will contain the role for the bot to delete when the command is executed. Only [role options](/custom-commands-and-events/options/role-option.md) in this field may work, IDs and [variables](/custom-commands-and-events/variables.md) can be used in [#role-id](#role-id "mention").

### Role Option

You must have a [role option](/custom-commands-and-events/options/role-option.md) added in your command for this to work.

<figure><img src="/files/OuGQpOG2R7GpKruATzsx" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/jxpsZlyEZPmoa4g8MHTK" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Role ID" %}
This selection will target a specific role ID / [variable](/custom-commands-and-events/variables.md) to delete.

### Role ID

This field accepts a plain role ID or [variable](/custom-commands-and-events/variables.md) that returns a plain role ID. This role ID can't have any spaces or extra symbols, make sure it is a plain role ID.

<figure><img src="/files/LwuB92I2kf8eVzBmJuHV" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/4MS7QuEBT40gdRpJ1aHf" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Name

The new name for the role the bot is editing. Leave this blank if you do not wish to change the name.

<figure><img src="/files/chyFEGRsLnkYZOXmFBYW" alt=""><figcaption></figcaption></figure>

## Reason

This field is an optional reason for editing the role. This reason will be shown in the audit log of the server that the command / event was executed in.

<figure><img src="/files/EaqXGdhn6y0uIyi3ULHD" alt=""><figcaption></figcaption></figure>

## Position

This field is optional and changes the position of the edited role in your server. Leave this blank for default positioning. Positions are all arranged from bottom (default) to top. This field only accepts integers and [variables ](/custom-commands-and-events/variables.md)can be used.

<figure><img src="/files/S2c45aY8jjdo80Or4oah" alt=""><figcaption></figcaption></figure>

## Color

This field is optional and changes the color of the role the bot is editing. **This field only accepts a HEX format.** Server members use the color of the highest position role they have. [Variables ](/custom-commands-and-events/variables.md)can be used as well. Leaving this field blank will make it a default grey color.

<figure><img src="/files/uLSQKmMfbprDRFFS1ZsY" alt=""><figcaption></figcaption></figure>

Hex format example: #af5555

<figure><img src="/files/sDtPJpSEvgQEP3hV5DEX" alt=""><figcaption></figcaption></figure>

## Display role members separately from online members

This switch controls whether the role is hoisted or not.

<figure><img src="/files/SslkceuRbp3yek1W6Kn3" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/bNMLwrlANowFNZ2aPkGy" alt=""><figcaption><p>Blue role is not hoisted</p></figcaption></figure>

## Mentionable

This switch will allow anyone to mention / @ this role, even if they don't possess the mention @everyone / @here permission.

<figure><img src="/files/KhJ1rzSWuPffMP5kTjAR" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/pnT1475L69QzlGR9Igz1" alt=""><figcaption></figcaption></figure>

## Permissions

Click the "+" to attach certain permissions to the role the bot is editing. Leave this field blank to have no permissions. Visit this [link](https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags) to learn more about permissions.

<figure><img src="/files/0dVIxwaoKZ9xNaAz56mI" alt=""><figcaption></figcaption></figure>

## Enable Success/Error Handles

Enable Success / Error Handles to detect success and errors inside of the action block. This allows you to run different actions if something goes wrong with your action. Inside of the handle, there are 2 different paths which are used to detect the outcome of the action. The green path on the bottom left side of the block indicates success, while the red path on the bottom right side of the block indicates error. You may attach action blocks to each side of the handle to get the outcome of your action block.

<figure><img src="/files/pYtBPljHi13YFv89blSF" alt=""><figcaption></figcaption></figure>

The Success/Error Handles feature includes 3 different error variables you can use to get information on why the action block encountered an error. Check them out [here](/custom-commands-and-events/variables.md#error-variables).

<figure><img src="/files/i83ylvvBSlx8LDGrXqlJ" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.botghost.com/custom-commands-and-events/actions/role-actions/edit-role.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
