# Koja Chat

Koja Chat is a roleplay chat for FiveM that replaces the default `chat` resource.
Every script that uses `chat:addMessage`, `chat:addSuggestion`, `chatMessage` or `exports.chat` keeps working, and you get channel tabs, RP commands, moderation and a clean API on top.
It is built on [koja-lib](/koja-lib/getting-started).

This section covers version **1.2.1** of the resource.

## What you get

| Area | What is in it |
| --- | --- |
| Channel tabs | Local (proximity), OOC, Social, department chat, Staff. Unread counters, and the active tab is where your message goes |
| RP commands | `/me`, `/do`, `/try`, `/looc`, `/s`, `/w`, `/ooc`, `/twt`, `/dw`, `/ad`, `/dep`, `/a` with optional 3D text or speech bubbles above the head |
| Private messages and reports | `/pm`, `/r` with a sound ping, `/report` to every online staff member |
| Moderation | `/mute` saved by license, `/slowmode`, `/clearall`, `/announce`, anti-spam with auto mute, word filter, link blocking, staff can delete messages |
| Suggestions | Help text, the parameter you are typing is highlighted, Tab to complete |
| Quality of life | Message history, emoji picker, shortcodes, `**bold**` `*italic*` `~~strike~~`, `@mentions`, typing indicator, timestamps, fade when idle, select and copy |
| Player settings | Style, main colour, position, size, width, background opacity, timestamps, fade, sounds and compact mode, saved per player |
| 12 styles | `appearance`, `velmor`, `velmor2`, `grids`, `modern`, `emerald`, `samp`, `nightshift`, `discord`, `twitch`, `bubble`, `terminal` |
| Speech bubbles | Animated bubbles above heads, messages type out letter by letter |
| Images | Link previews from whitelisted hosts and Ctrl+V image paste |
| Extras | Polls, a pinned message, key binds, `/coords`, `/ignore`, an optional developer console tab |
| Logs | Discord webhooks per channel, private messages, reports and moderation |
| Developer API | Server and client exports, hooks, custom channels and commands, badges, `import.lua` and events |

## Quick facts

- **Frameworks:** ESX, QBCore, QBX and custom, through koja-lib (names, jobs, money, admin groups).
- **Requires:** `koja-lib`. It replaces the default `chat` resource (`provide 'chat'`).
- **OneSync:** recommended, because proximity is calculated on the server. Without it the clients filter by distance.
- **Storage:** no database. Mutes and the pinned message are kept in the resource KVP, key binds and player settings on the player's side.
- **Languages:** `en` and `pl`.
- **Cleanup:** everything another resource registers (channels, commands, hooks) is removed when that resource stops.

## Start here

:::steps

### Install it

[Installation](/new/chat/installation) — requirements, removing the default chat and `server.cfg` order.

### Configure it

[Configuration](/new/chat/configuration) — every option in `editable/config.lua` and the server and client hooks.

### Learn the commands

[Commands](/new/chat/commands) — player, RP and staff commands.

### Use it from your own code

[Developer API](/new/chat/developer-api) — exports, hooks, channels, polls, events and default chat compatibility.

:::

## In this section

::::cards{cols="2"}
:::card{title="Installation" href="/new/chat/installation" icon="download"}
Requirements, removing the default chat, start order.
:::
:::card{title="Configuration" href="/new/chat/configuration" icon="settings"}
Every Config option and the editable files.
:::
:::card{title="Commands" href="/new/chat/commands" icon="terminal"}
Player, RP and staff commands.
:::
:::card{title="Developer API" href="/new/chat/developer-api" icon="code"}
Exports, hooks, events and compatibility.
:::
:::card{title="Troubleshooting" href="/new/chat/troubleshooting" icon="bug"}
Fixes for the problems people actually hit.
:::
::::
