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

# Configuration

Configure dm-chat message timing, proximity distances, commands, message types, and server announcements.

Edit `dm-chat/config.lua`, save it, then run `restart dm-chat`.

## Timing and proximity

```lua
Config.MessageDisplayTime = 3000
Config.MeDoeDistanc = 15.0
Config.OOCDistanc = 20.0
```

| Setting              | Unit         | Controls                                              |
| -------------------- | ------------ | ----------------------------------------------------- |
| `MessageDisplayTime` | Milliseconds | Idle time before visible chat messages begin fading   |
| `MeDoeDistanc`       | Game units   | Who receives `/me` and `/do` entries in the chat feed |
| `OOCDistanc`         | Game units   | Who receives `/ooc` in the chat feed                  |

{% hint style="warning" %}
The names `MeDoeDistanc` and `OOCDistanc` are intentionally documented with their current spelling. Use those exact keys or the script will keep its old values.
{% endhint %}

The animated popup above a player has its own built-in 25-unit range and a five-second lifetime. The config distances above control chat-feed delivery, not that popup range.

## Command switches

```lua
Config.EnableSay = true
Config.EnableMe = true
Config.EnableDo = true
Config.EnableOOC = true

Config.EnableGifs = true
Config.EnableMusic = true
Config.EnableVideo = true
```

Set a value to `false` to stop that command from doing anything. The built-in `/ooc`, `/me`, `/do`, `/gif`, `/music`, and `/video` suggestions are registered even when their feature is disabled, so they can remain visible after a restart.

## Message visibility

```lua
Config.DisabledTypes = {
    console = false,
    system = false,
    ooc = false,
    me = false,
    do = false
}
```

This section is a hide list:

| Value   | Result                                            |
| ------- | ------------------------------------------------- |
| `false` | Messages of that type remain visible              |
| `true`  | Messages of that type are discarded by the client |

For example, hide server-console output without hiding normal system messages:

```lua
Config.DisabledTypes = {
    console = true,
    system = false,
    ooc = false,
    me = false,
    do = false
}
```

## Emoji switch

```lua
Config.EnableEmojis = true
```

Set this to `false` to hide the emoji menu button. The available emoji list is configured separately; see [UI Theme and Emojis](/devmosaic/resources/devmosaic-dm-chat/ui-theme-and-emojis.md).

## Join and quit announcements

These are server convars rather than Lua config entries:

```cfg
set chat_showJoins 1
set chat_showQuits 1
```

Change either value to `0` to hide that announcement. The default is `1` when a convar is not set.

## Player names

The included `getCharName` function currently returns FiveM's `GetPlayerName(source)`. That name is used by `/say`, `/me`, `/do`, and media cards. `/ooc` also uses `GetPlayerName` directly.

To display framework character names, connect your framework inside `server/main.lua`. A Qbox example is already included there as commented code:

```lua
local function getCharName(source)
    if GetResourceState('qbx_core') == 'started' then
        local player = exports.qbx_core:GetPlayer(source)
        if player then
            local charinfo = player.PlayerData.charinfo
            return charinfo.firstname .. ' ' .. charinfo.lastname
        end
    end

    return GetPlayerName(source)
end
```

{% hint style="info" %}
Changing `getCharName` does not change `/ooc` unless you also replace its direct `GetPlayerName(source)` call.
{% endhint %}
