> For the complete documentation index, see [llms.txt](https://docs.rainmad.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainmad.com/resources/watch-admin-menu/features/staff-chat.md).

# Staff chat

A chat for your staff team, in the **Staff chat** tab of the menu and on the **Staff chat** page of the web panel. It is one chat: a message typed in game shows on the web and the other way round, usually within a second or two.

## Channels

| Channel             | Who sees it                                                                                                                                                           |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| General             | Every staff member who may use the chat.                                                                                                                              |
| One per staff group | That group and every group ranked above it. The Owner channel is the owner's alone.                                                                                   |
| Custom channels     | Only the members you pick. Admins create, rename, change members and delete them (the **+** beside Channels, or **Edit channel**). Deleting one deletes its messages. |
| Direct messages     | The two people in it. Start one with the **+** beside Direct messages.                                                                                                |
| Ticket threads      | Every open ticket. Its thread is the ticket's **internal notes**: a note written here shows in the ticket and the other way round. The player never sees either.      |

A web panel member without a game account writes under their Discord name, marked **web**. A staff member whose Discord is linked to FiveM is the same person on both sides.

## Messages

* **Enter** sends, **Shift Enter** starts a new line.
* **Edit** and **Delete** sit on your own messages. Admins can delete anyone's message; that goes in the staff log with what it said.
* **Load older messages** pages back, 50 at a time.
* The search box searches every channel you can see.
* The microphone records a [voice note](https://docs.rainmad.com/resources/watch-admin-menu/features/voice-notes-and-staff-voice).

## Mentions and unread counts

* Type `@` and pick a name. The person gets a notification in game and an **@** count on the web panel.
* `@12` (a server id) or the name of an online player becomes a link that opens that player.
* A direct message notifies too, unless you have it open.
* The **Staff chat** tab and every channel show how many messages you have not read.

## Configuration

```lua
cfg.chat = {
    retentionDays = 30,    -- older messages are deleted; 0 keeps them
    general = true,        -- the General channel
    groupChannels = true,  -- one channel per staff group
    ticketThreads = true,  -- open tickets and their internal notes
    maxLength = 1000,      -- longest message, 50 to 1000
    toasts = true,         -- notification in game for a mention or a direct message
}
```

## Permissions

In the **Staff chat** category. Moderator by default: `chat:channels` (open the chat at all), `chat:history`, `chat:search`, `chat:send`, `chat:dm`, `chat:edit`, `chat:delete`, `chat:read`. Admin by default: `chat:moderate` (delete other people's messages), `chat:channel.save`, `chat:channel.delete`. Ticket threads also need `ticket:view`. The chat works off duty.

Other scripts can post into a channel with the `chatPost` export, see [Exports and events](https://docs.rainmad.com/resources/watch-admin-menu/reference/exports-and-events).
