> For the complete documentation index, see [llms.txt](https://titans-productions.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://titans-productions.gitbook.io/documentation/redm/tp-libs/discord-roles-support.md).

# Discord Roles Support

Currently, we support discord roles for giving permissions in our scripts not only through groups and ace permissions, but also through discord roles!

### How does that work? What do i have to do?<br>

1. You have to insert the discord bot token that has been created through [Discord Developer Portal](https://discord.com/developers/applications) - this is where you have to create a **bot** for your discord server (if you don't have already), and you have to invite it to your discord server.&#x20;

2. Once the **bot** has been created, you have to go to the **Bot** section and click **Reset Token.**\ <br>

   <figure><img src="https://1388375997-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY2RtqVuE0tQRiqtUiG9D%2Fuploads%2FA6mYk86nMcjyY7kkKQJJ%2F%CE%B5%CE%B9%CE%BA%CF%8C%CE%BD%CE%B1.png?alt=media&amp;token=e7d2f12c-5c99-4470-ab62-a384e491885f" alt=""><figcaption></figcaption></figure>

3. Then, you have to insert the token on `tp_libs/server/discordapi.lua` where **TOKEN** is requested from you.\ <br>

   <figure><img src="https://1388375997-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY2RtqVuE0tQRiqtUiG9D%2Fuploads%2FC9fHhtUW7NMCOnKVm8Xq%2F%CE%B5%CE%B9%CE%BA%CF%8C%CE%BD%CE%B1.png?alt=media&amp;token=661c478d-9167-46c6-aa04-511bcdbe516a" alt=""><figcaption></figcaption></figure>

4. Once done, the only part that is left is `Config.DiscordServerID = 'xxxxxxxxxxxxxxxxxxxx'` section which requires your Discord Server Id that can be taken by clicking your discord server icon.\ <br>

   <figure><img src="https://1388375997-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY2RtqVuE0tQRiqtUiG9D%2Fuploads%2FcMNMbzb8LdWGCNHm9fjK%2F%CE%B5%CE%B9%CE%BA%CF%8C%CE%BD%CE%B1.png?alt=media&amp;token=bdd35891-af81-4d14-a0c4-e1efe9facba1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
In case you don't have the **Copy Server ID**, you have to enable **Developer Mode** on your discord user settings.
{% endhint %}

{% hint style="danger" %}
DO NOT INSERT THE TOKEN IN THE CONFIGURATION FILE! ONLY THE **DISCORD SERVER ID**!
{% endhint %}
