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

# Managing Discord Roles and Members in erlc.dev Studio

> Manage Discord roles and server members from your automations: add/remove roles, kick, ban, timeout, and look up Roblox verification status.

Studio gives you comprehensive blocks for managing every aspect of your Discord server's membership — from assigning and configuring roles to moderating members with kicks, bans, and timeouts. You can also query the erlc.dev verification system to look up the Roblox identity behind any Discord account and vice versa.

## Role Management

### Adding and Removing Roles

* **`erlc_bot_add_role`** — Assign a role to a server member.
  * Inputs: `MEMBER_ID`, `ROLE_ID`
* **`erlc_bot_remove_role`** — Remove a role from a server member.
  * Inputs: `ROLE_ID`, `MEMBER_ID`

### Creating and Deleting Roles

* **`erlc_bot_create_role`** — Create a new role in the server. Set `RESULT_VARIABLE` to store the new role's ID for use in later blocks.
  * Inputs: `NAME`, `COLOR`
  * Field: `RESULT_VARIABLE`
* **`erlc_bot_delete_role`** — Permanently delete a role from the server.
  * Input: `ROLE_ID`

### Editing Role Properties

<CardGroup cols={2}>
  <Card title="Edit Name and Color" icon="pen">
    **`erlc_bot_edit_role`** — Rename a role and change its color.

    Inputs: `ROLE_ID`, `NAME`, `COLOR`
  </Card>

  <Card title="Hoist Setting" icon="flag">
    **`erlc_bot_set_role_hoist`** — Control whether the role is displayed separately in the member list.

    Field: `ENABLED` (`true` / `false`)
  </Card>

  <Card title="Mentionable Setting" icon="at">
    **`erlc_bot_set_role_mentionable`** — Control whether members can mention this role with `@`.

    Field: `ENABLED` (`true` / `false`)
  </Card>

  <Card title="Role Position" icon="arrow-up-arrow-down">
    **`erlc_bot_set_role_position`** — Move a role to a specific position in the role hierarchy.

    Inputs: `ROLE_ID`, `POSITION`
  </Card>
</CardGroup>

### Role Permissions

**`erlc_bot_set_role_permission`** — Grant or deny a specific permission for a role server-wide.

| Input / Field | Description |
| - | - |
| `ROLE_ID` input | The role to modify |
| `ROLE_PERMISSION` field | The permission to change (see table below) |
| `PERMISSION_STATE` field | `allow` to grant, `deny` to revoke |

Available `ROLE_PERMISSION` values:

| Value | Description |
| - | - |
| `view_channel` | View channels |
| `send_messages` | Send messages |
| `manage_messages` | Manage messages |
| `manage_channels` | Manage channels |
| `manage_roles` | Manage roles |
| `mention_everyone` | Mention @everyone / @here |
| `connect` | Connect to voice channels |
| `speak` | Speak in voice channels |
| `mute_members` | Mute members in voice |
| `deafen_members` | Deafen members in voice |
| `move_members` | Move members between voice channels |
| `manage_threads` | Manage threads |
| `send_messages_in_threads` | Send messages in threads |
| `create_instant_invite` | Create instant invites |

**`erlc_bot_edit_role_channel_permissions`** — Override permissions for a role in a specific channel.

| Input / Field | Description |
| - | - |
| `CHANNEL_ID` input | The channel to modify overrides for |
| `ROLE_ID` input | The role to apply overrides to |
| `PERMISSIONS` field | The permission overrides to set |

***

## Member Actions

### Moderation

<CardGroup cols={2}>
  <Card title="Kick" icon="door-open">
    **`erlc_bot_kick`** — Remove a member from the server. They can rejoin via invite.

    Input: `MEMBER_ID`
  </Card>

  <Card title="Ban" icon="ban">
    **`erlc_bot_ban`** — Permanently ban a member from the server.

    Input: `MEMBER_ID`
  </Card>

  <Card title="Unban" icon="rotate-left">
    **`erlc_bot_unban`** — Lift an existing ban.

    Input: `MEMBER_ID`
  </Card>

  <Card title="Timeout" icon="clock">
    **`erlc_bot_timeout`** — Temporarily restrict a member from sending messages or joining voice.

    Inputs: `MEMBER_ID`, `SECONDS`
  </Card>
</CardGroup>

### Profile and Voice Actions

* **`erlc_bot_change_nickname`** — Change a member's server nickname.
  * Inputs: `MEMBER_ID`, `NICKNAME`
* **`erlc_bot_set_member_mute`** — Server-mute or unmute a member in voice.
  * Inputs: `MEMBER_ID`; Field: `ENABLED` (`true` / `false`)
* **`erlc_bot_set_member_deafen`** — Server-deafen or undeafen a member in voice.
  * Inputs: `MEMBER_ID`; Field: `ENABLED` (`true` / `false`)
* **`erlc_bot_disconnect_member`** — Forcibly disconnect a member from their current voice channel.
  * Input: `MEMBER_ID`
* **`erlc_bot_move_member`** — Move a member to a different voice channel.
  * Inputs: `MEMBER_ID`, `CHANNEL_ID`

***

## Member Query Value Blocks

These are **value blocks** — they return data that you can use as inputs to other blocks.

| Block | Inputs | Returns |
| - | - | - |
| `erlc_discord_member_has_role` | `MEMBER_ID`, `ROLE_ID` | `true` / `false` — whether the member has that role |
| `erlc_discord_member_roles` | `MEMBER_ID` | List of role IDs the member currently holds |
| `erlc_discord_member_voice_channel` | `MEMBER_ID` | The ID of the voice channel the member is in (empty if not in voice) |
| `erlc_discord_member_has_permission` | *(field: PERMISSION dropdown)* | `true` / `false` — whether the member has the selected permission |
| `erlc_discord_member_count` | *(no inputs)* | Total number of members in the server |

***

## Channel Access Control

Use these blocks to grant or revoke a specific member or role's access to a channel.

* **`erlc_bot_add_user_to_channel`** — Add a channel permission override that grants access.
  * Inputs: `MEMBER_ID`, `CHANNEL_ID`
  * Fields: `TARGET_TYPE` (`member` or `role`), `PERMISSION`
* **`erlc_bot_remove_user_from_channel`** — Remove the access override from a channel.
  * Inputs: `MEMBER_ID`, `CHANNEL_ID`
  * Field: `TARGET_TYPE` (`member` or `role`)

***

## Webhook Persona

These blocks let you customise the display name and avatar of a webhook message before sending it.

* **`erlc_discord_avatar`** — Set the webhook avatar. Inputs: `AVATAR` (image URL), `URL` (webhook URL), `CONTENT`
* **`erlc_discord_username`** — Set the webhook username/display name. Inputs: `USERNAME`, `URL` (webhook URL), `CONTENT`

***

## Roblox ↔ Discord Verification

The erlc.dev verification system links Roblox and Discord accounts. Use these value blocks to query the link in either direction.

<Note>
  These blocks only return data for users who have verified their Roblox account through the erlc.dev verification system. Unverified users will return empty or `false` values.
</Note>

### Discord → Roblox

| Block | Input | Field | Returns |
| - | - | - | - |
| `erlc_roblox_verified` | `DISCORD_USER_ID` | — | `true` if the Discord user has a linked Roblox account |
| `erlc_roblox_identity` | `DISCORD_USER_ID` | `FIELD`: `user_id` or `username` | The linked Roblox user ID or username |

### Roblox → Discord

| Block | Input | Returns |
| - | - | - |
| `erlc_roblox_discord_verified` | `ROBLOX_USER_ID` | `true` if the Roblox user has a linked Discord account |
| `erlc_roblox_discord_id` | `ROBLOX_USER_ID` | The linked Discord user ID |

### Utility

* **`erlc_roblox_discord_user_source`** — Returns a Discord user ID from the current event context. Use the `SOURCE` field to select which part of the event to read from.
* **`erlc_roblox_user_id_by_username`** — Look up a Roblox user ID by their username. Input: `USERNAME`

***

## Server Management

* **`erlc_bot_leave_guild`** — Instruct the bot to leave a server. Input: `GUILD_ID`

<Warning>
  `erlc_bot_leave_guild` is irreversible within the automation. Only use it in flows that are clearly intentional and well-guarded by conditions.
</Warning>

***

## Example: Add a Role After Verifying Roblox Identity

The JSON below checks whether a Discord user is verified, then assigns a "Verified" role if they are.

```json theme={null}
{
  "type": "erlc_if_then",
  "id": "check_verified",
  "inputs": {
    "IF0": {
      "block": {
        "type": "erlc_roblox_verified",
        "id": "is_verified",
        "inputs": {
          "DISCORD_USER_ID": {
            "block": {
              "type": "erlc_discord_event_value",
              "id": "user_id_event",
              "fields": { "FIELD": "UserId" }
            }
          }
        }
      }
    },
    "DO0": {
      "block": {
        "type": "erlc_bot_add_role",
        "id": "add_verified_role",
        "inputs": {
          "MEMBER_ID": {
            "block": {
              "type": "erlc_discord_event_value",
              "id": "member_id_event",
              "fields": { "FIELD": "UserId" }
            }
          },
          "ROLE_ID": {
            "block": {
              "type": "erlc_discord_role_value",
              "id": "verified_role",
              "fields": { "ID": "9876543210987654321" }
            }
          }
        }
      }
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.