> For the complete documentation index, see [llms.txt](https://dtrx-studio.gitbook.io/dtrx-studio-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dtrx-studio.gitbook.io/dtrx-studio-docs/fivem-products/dtrx-chat/commands.md).

# Commands

## Commands

{% hint style="warning" %}
Most chat traffic is handled **server-side** (validation, rate limits, DB).\
Channel commands and admin tools are registered when the resource starts.\
Admin access requires **ACE** `dtrx_chat.admin` **or** a framework group listed in `ChatConfig.Admin.FrameworkGroups`.
{% endhint %}

***

Default key is set in `public/shared/config.lua`:

```lua
Keybinds = {
    OpenChat = "T",
},
```

After you change `OpenChat` or rename `Commands.OpenChat`, run `restart dtrx_chat` on the server.

***

### Keybind changed in config but still wrong in game?

{% hint style="info" %}
FiveM **saves keybinds per player** on their PC the first time they connect. Changing `ChatConfig.Keybinds.OpenChat` on the server updates the **default for new binds**, but players who already joined may still use the old key stored locally.

**Server owner:** `restart dtrx_chat` after editing `config.lua`.

**Players (or staff helping a player):** clear the saved bind in the FiveM config file, then restart the game client.
{% endhint %}

#### Steps (Windows)

1. Press **WIN + R**, type `%appdata%`, and press Enter.
2. Open: `CitizenFX` → `fivem.cfg`\
   Full path example:\
   `C:\Users\YourName\AppData\Roaming\CitizenFX\fivem.cfg`
3. Open `fivem.cfg` in Notepad or any text editor.
4. Search for lines containing **`dtrx_chat_open`** (or your custom `Commands.OpenChat` name if you renamed it).
5. Delete those lines, or remove only the bind you want to reset.

**Example line to remove (default command name):**

```cfg
rbind dtrx_chat_open KEYBOARD T "+dtrx_chat_open"
```

If you renamed the open command in config, search for that name instead (for example `my_open_chat`).

6. Save the file and **fully restart FiveM** (not just reconnect).
7. Join the server again. The key from your server config should apply. Players can still change it later under **Settings → Key Bindings → FiveM** (look for **Open Chat (dtrx)**).

{% hint style="info" %}
**Mac:** use `~/Library/Application Support/CitizenFX/fivem.cfg` instead of `%appdata%`.
{% endhint %}

{% hint style="warning" %}
This only affects the **open chat** key mapping. Sticky note keys (**E** / **G**) and placement keys are separate controls in `ChatConfig.Sticky` and are not stored the same way in `fivem.cfg`.
{% endhint %}

***

### Player keybind & chat UI

| Input           | Command / mapping                          | Permission  | Description                                                                |
| --------------- | ------------------------------------------ | ----------- | -------------------------------------------------------------------------- |
| **T** (default) | `+dtrx_chat_open` via `RegisterKeyMapping` | All players | Opens the chat window and focuses the input. Rebindable in FiveM settings. |
| Configurable    | `/dtrx_chat_open`                          | All players | Same as opening chat (default name from `ChatConfig.Commands.OpenChat`).   |
| Configurable    | `/dtrx_chat_close`                         | All players | Closes the chat NUI.                                                       |

***

### Player channel commands

{% hint style="info" %}
Channels created in the Admin Panel register their **command** as a chat suggestion and executable route (same as classic RP chat).
{% endhint %}

**Default commands** (on a fresh database):

| Command          | Channel | Description                                       |
| ---------------- | ------- | ------------------------------------------------- |
| `/all <message>` | ALL     | Global chat                                       |
| `/me <message>`  | ME      | Roleplay action — local radius + optional 3D text |
| `/do <message>`  | DO      | Environment / scene description                   |
| `/ooc <message>` | OOC     | Out-of-character                                  |
| `/job <message>` | JOB     | Job-filtered channel (default: `police` only)     |

{% hint style="info" %}
Typing in the chat input while a channel tab is selected sends to that channel **without** typing the slash command. Commands still work from F8 or other scripts that execute them.
{% endhint %}

***

### Player sticky notes

| Command       | Permission                                          | Description                                                                                                                            |
| ------------- | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `/stickynote` | All players (if sticky enabled in Runtime Settings) | Opens the sticky note creation modal. Place with **E**, cancel **ESC**, rotate with scroll/arrows (see `ChatConfig.Sticky.Placement`). |

At an existing note (proximity):

| Key   | Default | Action                                                      |
| ----- | ------- | ----------------------------------------------------------- |
| **E** | `38`    | Read note content                                           |
| **G** | `47`    | Tear down / delete (owner or admin rules apply server-side) |

{% hint style="warning" %}
Key ids and labels are configurable under `ChatConfig.Sticky.Proximity`.
{% endhint %}

***

### Player in-UI actions (no extra commands)

| Feature                  | How to use                                                                              |
| ------------------------ | --------------------------------------------------------------------------------------- |
| **Private Message (PM)** | Chat sidebar → PM → enter target **server id**                                          |
| **Dice**                 | Dice button on supported channels (when channel `allowDice` and runtime `dice.enabled`) |
| **Voice message**        | Mic button when channel allows audio                                                    |
| **Location pin**         | Map pin button when channel allows location                                             |
| **Chat Settings**        | Gear icon → size, theme, locale, 3D ME/DO tuning, drag position                         |
| **Emoji**                | Emoji picker on channels with `allowEmoji`                                              |

***

### Admin commands

| Command      | Permission                                 | Description                                                                                                                  |
| ------------ | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| `/chatadmin` | `dtrx_chat.admin` or framework admin group | Requests admin access and opens the **Admin Panel** (Players, Categories, Control Messages, Runtime Settings, Themes, Logs). |

Default command name is set in `ChatConfig.Commands.AdminPanel` (default: `chatadmin`).

{% hint style="info" %}
You can also open admin tools from the chat sidebar (**Admin Panel** button) when your session is flagged as admin after bootstrap.
{% endhint %}

***

### Admin  in-panel actions (no slash commands)

| Area                 | Actions                                                                       |
| -------------------- | ----------------------------------------------------------------------------- |
| **Players**          | Mute, unmute, block, unblock, assign tags, send notice, view moderation state |
| **Categories**       | Create / edit / enable / disable / delete channels                            |
| **Control Messages** | Blocked words, wipe history per channel, auto-message scheduler               |
| **Runtime Settings** | Anti-spam, history caps, 3D defaults, sticky/dice limits, feature toggles     |
| **Themes**           | Edit built-in theme tokens, create custom themes, set server default          |
| **Logs**             | Paginated admin audit log with delete page / delete all                       |

***

### Granting admin access

{% hint style="info" %}
Add the following to your `server.cfg` or `permissions.cfg`:
{% endhint %}

```cfg
add_ace group.admin dtrx_chat.admin allow
```

**or**

```cfg
add_ace identifier.license:xxxxxxxxxxxx dtrx_chat.admin allow
```

{% hint style="info" %}
The permission string must match `ChatConfig.Admin.AcePermission` (default: `dtrx_chat.admin`).

**Framework groups (no ACE):** add your staff group name to `ChatConfig.Admin.FrameworkGroups` in `config.lua`.
{% endhint %}

***

### Renaming commands

Edit `ChatConfig.Commands` in `public/shared/config.lua`, then `restart dtrx_chat`:

```lua
Commands = {
    AdminPanel = "chatadmin",
    OpenChat   = "dtrx_chat_open",
    CloseChat  = "dtrx_chat_close",
},
Sticky = {
    Command = "stickynote",
},
```

{% hint style="warning" %}
Renaming does not change ACE names or channel command keys stored in the database — only the static command registrations above.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dtrx-studio.gitbook.io/dtrx-studio-docs/fivem-products/dtrx-chat/commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
