> For the complete documentation index, see [llms.txt](https://axiomemu.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://axiomemu.gitbook.io/docs/data/plugins/postcommand.md).

# PostCommand

Lets players broadcast a message to everyone online via a chat command (default `/post`). The plugin owns the command outright — there is no native fallback in `Command.dat` or `Command.xml`.

## File Location

`Data/Plugins/Social/PostCommand.xml`

## Configuration

### Command

| Attribute | Type   | Default | Description                                                     |
| --------- | ------ | ------- | --------------------------------------------------------------- |
| `name`    | string | `/post` | Chat trigger. Can be renamed to `/announce`, `/broadcast`, etc. |
| `enabled` | bool   | `true`  | `false` makes the plugin a no-op.                               |

### Cooldown

| Attribute | Type | Default | Description                                                   |
| --------- | ---- | ------- | ------------------------------------------------------------- |
| `seconds` | int  | `0`     | Per-player cooldown between successful uses. `0` disables it. |

### Restrictions

| Attribute          | Type | Default | Description                                                                                                                                                      |
| ------------------ | ---- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `maxMessageLength` | int  | `100`   | Max characters in the message body (excluding the command and prefix). Hard cap is 199 (the wire field is `char[200]`); values above that are truncated on send. |
| `minLevel`         | int  | `1`     | Minimum character level.                                                                                                                                         |
| `minVIP`           | int  | `0`     | Minimum VIP level. **Currently not enforced** (no code path); use `minLevel` instead.                                                                            |

### Cost

| Attribute | Type  | Default | Description                                                                                                                                                              |
| --------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `zen`     | int64 | `0`     | Zen charged per successful broadcast. `0` skips the check. Insufficient balance rejects the broadcast and takes nothing. Negative values clamp to `0`. Element optional. |

### Format

| Attribute | Type               | Default | Description                                                                                 |
| --------- | ------------------ | ------- | ------------------------------------------------------------------------------------------- |
| `prefix`  | string (≤31 chars) | `""`    | Text prepended to the message, separated by one space. Empty = no prefix. Element optional. |

### Appearance

Controls the colour of the broadcast bubble the client paints when it receives a `/post`. Each value is a byte (0-255). The whole `<Appearance>` block is optional; missing children fall back to the defaults below.

```xml
<Appearance>
    <BackgroundColor R="255" G="200" B="50"  A="200" />
    <TextColor       R="0"   G="0"   B="0"   A="255" />
</Appearance>
```

| Element           | Default RGBA        | Description                        |
| ----------------- | ------------------- | ---------------------------------- |
| `BackgroundColor` | `255, 200, 50, 200` | Bubble background colour and alpha |
| `TextColor`       | `0, 0, 0, 255`      | Message text colour and alpha      |

Both colour blocks are also re-streamed to the client on plugin reload.

## Examples

{% tabs %}
{% tab title="Shipped" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<PostCommand>
    <Command name="/post" enabled="true" />
    <Cooldown seconds="0" />
    <Restrictions maxMessageLength="100" minLevel="1" minVIP="0" />
    <Cost zen="1000000" />
    <Format prefix="[POST]" />
    <Appearance>
        <BackgroundColor R="255" G="200" B="50" A="200" />
        <TextColor R="0" G="0" B="0" A="255" />
    </Appearance>
</PostCommand>
```

{% endtab %}

{% tab title="Free + Cooldown" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<PostCommand>
    <Command name="/post" enabled="true" />
    <Cooldown seconds="120" />
    <Restrictions maxMessageLength="150" minLevel="50" minVIP="0" />
    <Cost zen="0" />
    <Format prefix="[POST]" />
</PostCommand>
```

{% endtab %}

{% tab title="Renamed + No Prefix" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<PostCommand>
    <Command name="/announce" enabled="true" />
    <Cooldown seconds="5" />
    <Restrictions maxMessageLength="199" minLevel="10" minVIP="0" />
    <Cost zen="0" />
    <Format prefix="" />
</PostCommand>
```

{% endtab %}

{% tab title="Disabled" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<PostCommand>
    <Command name="/post" enabled="false" />
    <Cooldown seconds="0" />
    <Restrictions maxMessageLength="100" minLevel="1" minVIP="0" />
    <Cost zen="0" />
    <Format prefix="[POST]" />
</PostCommand>
```

{% endtab %}
{% endtabs %}
