# fetchRole

`function` in `seedcord` · v0.14.0

<https://docs.seedcord.org/packages/seedcord/0.14.0/functions/fetch-role>

Fetches a role by ID from a client or guild. Refuses when the role doesn't exist.

```ts
async fetchRole(
    clientOrGuild: Client | Guild,
    roleId: string
): Promise<Role>
```

Fetches a role by ID from a client or guild. Refuses when the role doesn't exist.

Parameters.

- `clientOrGuild` `Client | Guild` — Discord client or guild instance
- `roleId` `string` — The role ID to fetch

Returns `Promise<Role>`.
