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

# Actions

> Make a custom command ban, kick, warn, move coins, or write to the server database.

# Actions

> Make a custom command ban, kick, warn, move coins, or write to the server database.

Actions let a custom command perform real operations. They reuse raze's native moderation pipeline, so hierarchy checks, immunity, and case logging all apply.

## Anatomy

```text theme={null} theme={null}
{TYPE:OPERATION (argument) && (argument) && [argument]}
```

* Arguments inside an action are separated by `&&`.
* The action tag is **removed** from the rendered message once it runs, so surrounding text stays visible.
* Actions run near the end of the pipeline, after variables and [database tags](/server-config/custom-commands/stored-data).

```bash theme={null} theme={null}
;cc set warnuser (target) [reason...] -- {mod:warn {target} && {reason|No reason given}}Warned {punishment.user.mention} — case #{punishment.case_id}.
```

```bash theme={null} theme={null}
;warnuser @wanderer spamming links
```

> Warned @wanderer — case #104.

### Naming a target

Anywhere an action expects a member you may pass:

| Form                              | Example                 |
| :-------------------------------- | :---------------------- |
| A mention                         | `@wanderer`             |
| A user ID                         | `481761571015327744`    |
| An argument variable              | `{target}`, `{member}`  |
| `user` or `self`                  | resolves to the invoker |
| An exact username or display name | `wanderer`              |

Roles accept a role mention, a role ID, or an exact role name.

Durations accept combined units — `30s`, `10m`, `1h30m`, `7d`, `2w` — and are capped at 28 days by Discord.

***

## Moderation actions

| Syntax                                             | Permission         | Does                                             |
| :------------------------------------------------- | :----------------- | :----------------------------------------------- |
| `{mod:ban (target) && [reason]}`                   | `ban_members`      | Bans the target.                                 |
| `{mod:softban (target) && [reason]}`               | `ban_members`      | Bans, clears 7 days of messages, then unbans.    |
| `{mod:kick (target) && [reason]}`                  | `kick_members`     | Kicks the target.                                |
| `{mod:timeout (target) && (duration) && [reason]}` | `moderate_members` | Times the target out.                            |
| `{mod:untimeout (target) && [reason]}`             | `moderate_members` | Lifts a timeout.                                 |
| `{mod:warn (target) && [reason]}`                  | `manage_messages`  | Issues a warning and bumps the warn count.       |
| `{mod:role.add (target) && (role) && [reason]}`    | `manage_roles`     | Adds the role.                                   |
| `{mod:role.remove (target) && (role) && [reason]}` | `manage_roles`     | Removes the role.                                |
| `{mod:role.toggle (target) && (role) && [reason]}` | `manage_roles`     | Adds the role if missing, removes it if present. |

`{mod:mute}` and `{mod:unmute}` are aliases for `timeout` and `untimeout`.

Every one of these writes a moderation case and fills the [`{punishment.*}` variables](/server-config/custom-commands/arguments-variables#moderator-and-punishment-data).

<Note>
  If the target is **immune** under your moderation settings, the action is skipped silently and no case is logged. Role actions also refuse roles that sit above raze or carry Administrator.
</Note>

***

## Economy actions (removed)

<Warning>
  `{econ:add}`, `{econ:remove}`, `{econ:set}`, and `{econ:transfer}` **no longer exist**. raze's economy is global — one balance per user across every server — so a Manage Server holder in any guild could have minted unlimited currency for themselves. Writing `{econ:add ...}` in a script now does nothing; the tag is left in the message as plain text.
</Warning>

The read-only economy **variables** are unaffected: `{econ.balance}`, `{econ.wallet}`, `{econ.bank}`, `{target.econ.balance}`, and the rest still work everywhere. See [Economy data](/server-config/custom-commands/arguments-variables#economy-data).

***

## Custom database actions

| Syntax                                                  | Permission     | Does                                   |
| :------------------------------------------------------ | :------------- | :------------------------------------- |
| `{customdb:set (namespace) && (key) && (value)}`        | `manage_guild` | Stores a string.                       |
| `{customdb:increment (namespace) && (key) && [amount]}` | `manage_guild` | Adds to a stored number (default `1`). |
| `{customdb:delete (namespace) && (key)}`                | `manage_guild` | Deletes the record.                    |

<Tip>
  These are the permission-gated, write-only form. To read a value, or to read back something you just wrote in the same response, use the inline [database tags](/server-config/custom-commands/stored-data) instead — those resolve earlier in the pipeline and render their result in place.
</Tip>

***

## Permission gating

<Steps>
  <Step title="When you save the command">
    `;cc set` scans the script, works out which permissions its actions need, and refuses to save unless **you** hold every one of them.
  </Step>

  <Step title="When someone runs it">
    The invoker must hold those same permissions — unless a user or role [allow entry](/server-config/custom-commands/restrictions) covers them, which bypasses the action permission check.
  </Step>
</Steps>

<Info>
  An **allowed channel** does not bypass permissions. Only user and role allow entries do.
</Info>

<Warning>
  A misspelled operation such as `{mod:bam ...}` maps to no permission, so it is neither gated nor executed. If it is the only action in the script the tag is left in the message as literal text; alongside a valid action it is silently dropped. Either way, run `;cc preview` before publishing.
</Warning>

Actions can also be attached to buttons and dropdown options; see [Embeds and components](/server-config/custom-commands/embeds-components#component-actions).
