> ## Documentation Index
> Fetch the complete documentation index at: https://rust-co.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord role slots

> Connect Discord roles to RCO Creator character-slot totals.

Use this when supporters/VIPs/staff should have a different **total number of character slots** based on a Discord role.

If you only need one or two manual exceptions, the simpler per-license/custom resolver may be a better fit. See [Character slots](/rco-creator/character-slots).

## What you need

* a Discord server;
* permission to create/invite an application bot;
* your Discord server ID;
* the role IDs you want to map;
* the bot token stored only in `rco-creator/config/server.lua`.

## 1. Enable Discord Developer Mode

In Discord settings, enable **Developer Mode**. This lets you copy the server (guild) ID and role IDs.

## 2. Create a Discord application/bot

Use the Discord Developer Portal, create an application and add a bot. Copy the bot token and invite the bot to the Discord server.

<Warning>
  Treat the bot token like a password. Never paste it into a support ticket, public repository or client-side file. If it leaks, reset the token immediately.
</Warning>

## 3. Copy the IDs

You need:

```text theme={"dark"}
Guild / Server ID
Supporter Role ID
VIP Role ID
...any other mapped roles
```

Keep role names for humans in your notes, but put the numeric role ID in the config.

## 4. Configure Creator

```lua theme={"dark"}
CreatorServerConfig.Discord = {
    enabled = true,
    guildId = '123456789012345678',
    botToken = 'YOUR_BOT_TOKEN',
    defaultSlots = 1,
    cacheSeconds = 600,
    timeoutMs = 8000,
    roleSlots = {
        ['987654321098765432'] = 3,
        ['876543210987654321'] = 5,
    },
}
```

The values in `roleSlots` are **total slots**.

If someone has both the 3-slot and 5-slot roles, they should resolve to the higher applicable total rather than 8.

## 5. Restart and test with a real role

Give yourself one mapped role, restart `rco-creator`, connect and count the unlocked slots.

Then change to another role and test again after the configured cache window/reconnect behavior.

## Common failures

| Symptom                        | Check                                                                 |
| ------------------------------ | --------------------------------------------------------------------- |
| Resource refuses to start      | `guildId` or `botToken` is empty/invalid                              |
| Everyone gets default          | Bot not in the guild, wrong guild ID or Discord lookup failing        |
| One player gets default        | Their Discord identifier/link is missing or they are not in the guild |
| Role has no effect             | Wrong role ID or cached old role result                               |
| Expected roles to add together | Slot values are totals, not bonuses                                   |

## When Discord is not enough

If you need Discord **plus** Tebex/manual exceptions, put the combined rule in `ResolveCustomSlots` instead of creating several competing sources of truth.
