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

# Button Roles

> Let members self-assign roles by clicking a button on any of raze's messages.

# Button Roles

> Let members self-assign roles by clicking a button on any of raze's messages.

## Overview

Button roles attach a persistent button to any message sent by raze. When a member clicks it, the role is toggled — added if they don't have it, removed if they do. Multiple buttons can coexist on the same message alongside [button messages](/server-config/button-messages).

Each button gets a unique **code** that you use to remove it later.

<Warning>
  Buttons can only be added to messages sent by raze.
</Warning>

## Add a button role

<CodeGroup>
  ```bash Syntax theme={null} theme={null}
  ;buttonrole add (message link) (label) (role) [style] [emoji]
  ```

  ```bash Example theme={null} theme={null}
  ;buttonrole add https://discord.com/channels/.../... Verify @Members green ✅
  ```
</CodeGroup>

| Parameter      | Required | Description                     |
| -------------- | -------- | ------------------------------- |
| `message link` | Yes      | Link to a raze message          |
| `label`        | Yes      | Button label text               |
| `role`         | Yes      | Role to toggle                  |
| `style`        | No       | Button color — see styles below |
| `emoji`        | No       | Emoji to display on the button  |

### Button styles

| Style                         | Color          |
| ----------------------------- | -------------- |
| `primary` / `blue`            | Blue (default) |
| `secondary` / `gray` / `grey` | Grey           |
| `success` / `green`           | Green          |
| `danger` / `red`              | Red            |

## Remove a button role

```bash theme={null} theme={null}
;buttonrole remove (code)
```

Use the code returned when the button was added.

## List button roles

```bash theme={null} theme={null}
;buttonrole list
```

Shows all button roles in the server with their codes, labels, roles, and styles.

***

## Full example

```bash theme={null} theme={null}
;say Welcome to the server! Pick your roles below.
;buttonrole add https://discord.com/channels/.../... Announcements @Announcements blue 🔔
;buttonrole add https://discord.com/channels/.../... Updates @Updates green 📢
;buttonrole add https://discord.com/channels/.../... Events @Events red 🎉
```
