> 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/cas-staff-chat.md).

# CAS Staff Chat

CAS Staff Chat for RedM: a private in-game chat for your admins, with Discord or Steam avatars, unread alerts and saved history. VORP and RSG.

**A private chat window for your staff, right inside RedM. Admins talk to each other in game without using the public chat or alt-tabbing to Discord.**

{% hint style="success" %}
Only the Steam accounts you list can open the chat, read it or write in it. Messages show each admin's Discord or Steam avatar and name. New messages arrive with a sound and an unread counter, and the history is kept between restarts.
{% endhint %}

## Highlights

* **Staff only**: access is checked on the server against your admin list, so other players can't open the chat or read it.
* **Discord or Steam identity**: each message shows the admin's Discord avatar and username, their Steam avatar, or their character name. You choose which.
* **Unread alerts**: while the chat is closed, new messages play a sound and show a counter badge. Each admin can switch the alerts on or off.
* **Saved history**: messages are kept in `messageData.json` and are still there after a restart.
* **Clear the history**: trusted admins can wipe the chat for everyone with one command.
* **Command or key**: open it with `/staffchat`, or with a key of your choice.
* **Light and standalone**: no database, and `cas_fwlibs` handles VORP Core or RSG Core.

## At a glance

|                  |                                                                           |
| ---------------- | ------------------------------------------------------------------------- |
| **Frameworks**   | VORP Core or RSG Core, through `cas_fwlibs`                               |
| **Dependencies** | `cas_fwlibs`. Optional: a Discord bot token for Discord avatars and names |
| **Database**     | None. History is saved to `messageData.json` in the resource folder       |
| **Access**       | Steam identifiers listed in `CAS.Admins`                                  |
| **Open**         | `/staffchat` (or a key), **Enter** to send, **Esc** to close              |

## Where to start

| Page                                                                         | What it covers                                                       |
| ---------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [Installation](/script-documentation/cas-staff-chat/installation.md)         | Requirements, adding your admins and the first checks.               |
| [Using the Chat](/script-documentation/cas-staff-chat/using-the-chat.md)     | Opening the chat, sending messages, alerts and clearing the history. |
| [Configuration](/script-documentation/cas-staff-chat/configuration.md)       | Every option in `config.lua` and `server_config.lua`, and languages. |
| [Discord Profiles](/script-documentation/cas-staff-chat/discord-profiles.md) | Setting up a bot token to show Discord avatars and usernames.        |
| [Troubleshooting](/script-documentation/cas-staff-chat/troubleshooting.md)   | What each problem means and how to fix it.                           |

## Get the script

CAS Staff Chat is sold on the CAS Scripts store: [codeaftersex.com/script/cas-staffchat](https://codeaftersex.com/script/cas-staffchat). Both the Escrow build and the full Open Source build are listed there, with lifetime updates and Discord support.
