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

# Channels & Commands

Channel tabs, RP commands, ads and commands without a slash.

## Channels or commands only

`Config.UseChannels` picks how the chat works.

{% tabs %}
{% tab title="Commands only (default)" %}
`Config.UseChannels = false`

* No tabs and no General channel.
* Plain text is not sent. The player gets "use a command".
* `/ooc` and `/ad` post to everyone.
* `Config.Channels` is ignored.
  {% endtab %}

{% tab title="Channel tabs" %}
`Config.UseChannels = true`

* Every enabled channel in `Config.Channels` gets a tab.
* Plain text goes to the open tab. In the "All" tab it goes to `Config.DefaultChannel` (`'general'`).
* `/ooc` posts in the OOC channel, `/ad` in the Ads channel.
  {% endtab %}
  {% endtabs %}

***

## Channels (`Config.Channels`)

Only used with `Config.UseChannels = true`. One line per channel, the order is the tab order.

| Field            | What it does                                                                                            |
| ---------------- | ------------------------------------------------------------------------------------------------------- |
| `Id`             | Unique name (letters, numbers, `_`). Built-in labels for `general`, `ooc`, `local`, `job`, `gang`, `ad` |
| `Enabled`        | `true` / `false`                                                                                        |
| `Type`           | `global` (everyone), `proximity` (within `Range`), `job`, `gang`, `ad` (everyone, ad rules)             |
| `Name`           | `'character'` (character name) or `'player'` (FiveM name, good for OOC)                                 |
| `Color`          | Line and tab color (`#rrggbb`)                                                                          |
| `Range`          | Meters, for `proximity`                                                                                 |
| `Jobs` / `Gangs` | Limit to these names, e.g. `{ 'police', 'ambulance' }`. Empty = every job / gang                        |
| `OnDutyOnly`     | Job channel only for players on duty                                                                    |
| `Label`          | Tab name for your own channels                                                                          |
| `Ace`            | ACE object, e.g. `'striga.chat.staff'`. Only players with it see and use the channel                    |

### Default channels

| Id        | Type        | On  | Name                       |
| --------- | ----------- | --- | -------------------------- |
| `general` | `global`    | yes | character                  |
| `ooc`     | `global`    | yes | player                     |
| `local`   | `proximity` | no  | character (`Range = 20.0`) |
| `job`     | `job`       | yes | character                  |
| `gang`    | `gang`      | no  | character                  |
| `ad`      | `ad`        | yes | character                  |

### Add your own channel

```lua
{ Id = 'ems', Enabled = true, Type = 'job', Name = 'character', Color = '#f87171', Jobs = { 'ambulance' }, Label = 'EMS' },
```

For a staff channel with `Ace`, add to `server.cfg`:

```
add_ace group.admin striga.chat.staff allow
```

***

## RP commands (`Config.Commands`)

Each command has `Enabled`, `Name` (the command without `/`) and optional `Override` (take the command over even if another resource made it).

| Command | Who sees it                         | Extra options                                                                                                    |
| ------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `/me`   | Players nearby (`Config.RpRange`)   | `Color`, optional `Range`. `Override = true` by default                                                          |
| `/do`   | Players nearby                      | `Color`, optional `Range`. `Override = true` by default                                                          |
| `/try`  | Players nearby                      | `Color`, optional `Range`                                                                                        |
| `/roll` | Players nearby                      | `Color`, `MaxDice` (5), `MaxSides` (100), optional `Range`. `/roll` = d6, `/roll 20` = d20, `/roll 2d6` = two d6 |
| `/looc` | Players nearby                      | `Color`, optional `Range`                                                                                        |
| `/ooc`  | OOC channel (everyone if it is off) | -                                                                                                                |
| `/ad`   | Ads channel (everyone if it is off) | `Cost` (0 = free), `Account` (`'bank'` or `'cash'`), `Cooldown` (60 seconds)                                     |

{% hint style="info" %}
Nearby commands need **OneSync**. Without it they only reach the sender.
{% endhint %}

### Ads

`/ad` (and writing in the Ads tab) follows the same rules: it costs `Cost` from `Account` and has a `Cooldown` per player. The money sign comes from `Config.Currency`.

### Commands your framework already has

qb-core and qbx\_core have their own `/me` and `/ooc`. Striga Chat checks this at start and leaves a command alone when another resource already made it. You see a line like `/me is already registered by qb-core` in the console. The OOC tab still works.

`/me` and `/do` have `Override = true` in the config. Striga Chat takes them over anyway, because the qb-core `/me` only shows 3D text and never writes in the chat. Set `Override = false` to keep your framework's version.

{% hint style="warning" %}
If you restart your framework while the server runs, restart `striga-chat` after it.
{% endhint %}

### Other commands

| Command       | What it does                                                                    |
| ------------- | ------------------------------------------------------------------------------- |
| `/togglechat` | Switches `whenactive` / `visible` / `hidden` (name from `Config.ToggleCommand`) |
| `/say`        | Server console message to everyone (only when no other resource made `say`)     |

***

## Commands without slash (`Config.Slashless`)

Default `'all'`: every command the player can use also runs without the `/` (`dv`, `e sit`, `me lights a cigarette`). While typing, the input shows the ME / DO tag or "Command".

| Value                           | What it does                      |
| ------------------------------- | --------------------------------- |
| `'all'`                         | Every command                     |
| `{ 'me', 'do', 'try', 'roll' }` | Only these `Config.Commands` keys |
| `{}`                            | Off                               |

{% hint style="warning" %}
On an English server `do` is a normal word ("do you have a lighter?"). Use a list without `do` there.
{% endhint %}

***

## Quick buttons

`Config.Ui.QuickButtons` (default `{ 'me', 'do', 'roll' }`) puts buttons under the input. Use keys from `Config.Commands`. `{}` hides them.

{% content-ref url="/pages/arr9Xvjw2OicBHVRHjiO" %}
[Exports & Events](/docs/striga-chat/exports-and-events.md)
{% endcontent-ref %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://striga.gitbook.io/docs/striga-chat/channels-and-commands.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
