> ## Documentation Index
> Fetch the complete documentation index at: https://pure.saauf.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Trace Chat Integrations: Register Custom Slash Commands

> Register custom slash commands in Trace Chat to let staff trigger server-side actions from the chat composer using permission-checked integrations.

Trace Chat is a cross-server, private, filtered workspace for your moderation team - completely separate from the game's public player chat. Staff members use it to communicate across server instances, run built-in commands, and trigger custom actions without ever leaving the Trace panel. Typing `/` in the Trace Chat composer opens the integration catalog, showing every registered slash command the current staff member has permission to use.

<Note>
  Trace Chat history is private, cross-server, and filtered. It is entirely distinct from the public player-facing Roblox chat and is never visible to regular players.
</Note>

***

## Built-in Integrations

Trace ships with a set of built-in slash command integrations that mirror the actions available in the admin panel - kick, warn, ban, mute, and more. These reuse the same server-authoritative logic and permission checks as the panel buttons, so granting a role the `ManagePlayer` permission automatically enables the matching slash commands for that role without any extra configuration.

***

## Custom Integrations

You can extend the slash command catalog with your own integrations using `Trace.RegisterChatIntegration`. Each integration binds a command name to a permission requirement and a server-side handler.

```lua theme={null}
Trace.RegisterChatIntegration("myreset", {
    Permission = "ManagePlayer",
    Description = "Reset the target player's character",
    Execute = function(caller, args)
        -- server-side handler: caller is the staff Player instance
        -- args contains the parsed command arguments
        local target = args.Target
        if target and target.Character then
            target:LoadCharacter()
        end
    end,
})
```

* **`Permission`** - the Trace permission key required to see and execute this command. Staff members who lack this permission will not see the command in autocomplete.
* **`Description`** - the label shown in the integration catalog when staff browse available commands.
* **`Execute`** - a server-side function called when a staff member dispatches the command. `caller` is the `Player` instance of the staff member; `args` contains the parsed payload.

To remove a custom integration at runtime:

```lua theme={null}
Trace.UnregisterChatIntegration("myreset")
```

<Warning>
  Always keep authorization and action logic inside the server-side `Execute` handler. Never trust or act on data sent directly from the client - Trace re-validates permissions on every dispatch, but your handler is responsible for any additional business logic checks.
</Warning>

***

## Permission Filtering

The integration catalog shown to each staff member is filtered at display time based on their role's permissions. A staff member who cannot see a command in autocomplete also cannot dispatch it - the server re-validates permissions when the command arrives, so there is no client-side bypass path.

***

## Mention Tokens

In the Trace Chat composer, typing `@` opens a suggestion popover with users currently in the session, configured roles, and the `@everyone` token. Mention payloads are validated by the server before delivery, so a staff member cannot fabricate a mention for a user or role that does not exist in the current context.
