# GetRoleIdFromRoleName

## GetRoleIdFromRoleName

<mark style="color:blue;">`GET`</mark> `exports.Badger_Discord_API:GetRoleIdFromRoleName(roleName)`

This export allows you to get a Discord role ID from what it is named on the Guild.

#### Query Parameters

| Name     | Type   | Description                                       |
| -------- | ------ | ------------------------------------------------- |
| roleName | string | The name of the Discord role you want the ID for. |

{% tabs %}
{% tab title="200 Number of role ID will be returned:" %}

```
761459588058185738
```

{% endtab %}

{% tab title="404 Could not find a role with the name provided:" %}

```
nil
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.badger.store/fivem-discord-scripts/badger_discord_api/getroleidfromrolename.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
