> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-staff-chat/discord-profiles.md).

# Discord Profiles

Show Discord avatars and usernames in CAS Staff Chat: create a Discord bot, copy its token into server\_config.lua and switch the options on.

To show each admin's Discord avatar and username, the server reads their profile from Discord with a bot token. The bot doesn't need to join your Discord server and needs no special permissions.

## Creating the bot token

1. Open the [Discord Developer Portal](https://discord.com/developers/applications) and click **New Application**. Give it any name.
2. Open the **Bot** tab and click **Reset Token**. Copy the token.
3. Paste it into `server_config.lua`:

```lua
Config = {
    UseDiscordAvatar = true,
    UseDiscordName   = true,
    DiscordBotToken  = "PASTE-YOUR-BOT-TOKEN-HERE",
}
```

4. Restart the resource.

{% hint style="danger" %}
A bot token works like a password. Never share it, never paste it in a public channel, and never publish your `server_config.lua`. If a token leaks, click **Reset Token** in the Developer Portal right away. That makes the old token stop working.
{% endhint %}

## What each admin needs

Discord must be running on the admin's PC when they join, so that the server sees their Discord identifier. Without it, their profile can't be looked up, and their messages show no Discord avatar or name.

## Without a bot

Set both options to `false` to use Steam instead:

```lua
Config = {
    UseDiscordAvatar = false,
    UseDiscordName   = false,
    DiscordBotToken  = "",
}
```

Admins then appear with their Steam avatar, and with their Steam name or character name (see `UseSteamName` in [Configuration](/script-documentation/cas-staff-chat/configuration.md)).
