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

# Button Roles

> Let members grab their own roles by clicking a button.

## Overview

Button roles attach clickable buttons to a message. A member clicks one, gets the role, clicks again to drop it. Common uses are pronoun pickers, ping opt-ins, and verification gates.

<Warning>
  Buttons can only be attached to messages **confine sent**. Discord doesn't allow bots to edit other users' messages, so point these commands at an embed you built with confine. See [Embed Scripting](/resources/scripting) for building one.
</Warning>

<Info>
  You need **Manage Roles** to run these commands, and confine needs it too.
</Info>

## Adding a button

<CodeGroup>
  ```javascript Syntax theme={null}
  ,buttonrole add (message) (role) (style) (emoji) (label)
  ```

  ```javascript Example theme={null}
  ,buttonrole add https://discord.com/channels/... Verified green ✅ Verify
  ```
</CodeGroup>

### Targeting the message

Two formats work:

| Input        | When to use it                                                          |
| ------------ | ----------------------------------------------------------------------- |
| Message link | Anywhere — right-click the message and copy its link                    |
| Message ID   | Only when you're running the command in the same channel as the message |

### Styles

Pick one of `green`, `blurple`, `gray`, or `red`. This is purely visual — it doesn't change what the button does.

### Labels and emojis

Labels cap at **80 characters**. Emojis can be standard Unicode or a custom emoji, as long as it's one confine has access to.

### Limits

| Limit               | Value                                         |
| ------------------- | --------------------------------------------- |
| Buttons per message | 25                                            |
| Roles per message   | One button per role — duplicates get rejected |

## Roles confine won't accept

Some roles are blocked on purpose:

<AccordionGroup>
  <Accordion title="Roles with dangerous permissions">
    A self-assignable role that grants moderation power is a security hole, so confine rejects any role carrying one of these:

    `administrator`, `manage_guild`, `manage_channels`, `manage_messages`, `kick_members`, `ban_members`, `moderate_members`, `manage_roles`, `manage_threads`, `view_audit_log`, `manage_webhooks`, `manage_expressions`, `mention_everyone`
  </Accordion>

  <Accordion title="Roles above confine">
    Confine can't assign a role positioned higher than its own. Drag confine's role above it in your server settings.
  </Accordion>

  <Accordion title="Roles above you">
    Unless you're the server owner, you can't set up a button for a role that sits at or above your highest role.
  </Accordion>

  <Accordion title="Managed and default roles">
    `@everyone` and roles tied to bots, boosts, or integrations can't be used.
  </Accordion>
</AccordionGroup>

## Removing buttons

### A single button

Run `,buttonrole list` first to find the number you want.

<CodeGroup>
  ```javascript Syntax theme={null}
  ,buttonrole remove (message) (button number)
  ```

  ```javascript Example theme={null}
  ,buttonrole remove https://discord.com/channels/... 1
  ```
</CodeGroup>

### Every button on one message

<CodeGroup>
  ```javascript Syntax theme={null}
  ,buttonrole removeall (message)
  ```

  ```javascript Example theme={null}
  ,buttonrole removeall https://discord.com/channels/...
  ```
</CodeGroup>

### Every button in the server

```javascript theme={null}
,buttonrole reset
```

Confine asks you to confirm with a button first — the prompt only listens to whoever ran it and expires after 30 seconds. On confirmation it strips the components from every affected message, not just the database entries. `,buttonrole clear` does the same thing.

## Viewing what's configured

`,buttonrole list` pages through every button role in the server with its message link, role, label, emoji, and style.
