# Look up roles

> Read roles by name, mention or id, and whether members can safely be given them.

Source: https://docs.buildcord.dev/nodes/server/look-up-roles/

`role.fetch` reads roles of the server, for role panels and anything else that hands out roles a member asks for.

## Settings

| Setting | What it does |
| --- | --- |
| Roles | Names, mentions or ids, separated by commas, such as `{option.roles}`. |
| Held by | Optional. A member whose roles are marked `held`, such as `{user.id}`. |

## Ways out

| Way out | When |
| --- | --- |
| `found` | At least one of the roles is in the server. |
| `none` | None of them are. |

## Tokens

| Token | Value |
| --- | --- |
| `{roles.list}` | The roles found, as a list. Each has `id`, `name`, `mention`, `position`, `managed`, `held`, `assignable` and `why`. |
| `{roles.ids}` | Their ids, separated by commas |
| `{roles.count}` | How many were found |
| `{roles.missing}` | What was asked for but isn't in the server |
| `{roles.problem}` | The first reason one of them can't be handed out, or nothing |
| `{roles.assignable}` | `true` when every role can be handed out |

A role can't be handed out when it's `@everyone`, is managed by an integration such as a booster or bot role, sits at or above the bot's highest role, or carries a permission that gives power over the server: Administrator, Manage Server, Manage Roles, Manage Channels, Manage Webhooks, Ban Members, Kick Members, Moderate Members, Mention Everyone or Manage Messages.

## Example

A role panel: look up the panel's roles held by `{user.id}`, then reply with a menu made from the list `{roles.list}`, with each choice's label `{item.name}`, value `{item.id}`, and **Picked already when** `{item.held}`. The member's current roles start picked.

## Related

- [Add role](https://docs.buildcord.dev/nodes/members/add-role)
- [Buttons and menus](https://docs.buildcord.dev/nodes/messages)
