Skip to Content
BuildcordDocs

Look up roles

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

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

Settings

SettingWhat it does
RolesNames, mentions or ids, separated by commas, such as {option.roles}.
Held byOptional. A member whose roles are marked held, such as {user.id}.

Ways out

Way outWhen
foundAt least one of the roles is in the server.
noneNone of them are.

Tokens

TokenValue
{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.

Was this page helpful?