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

# Invoke Messages

> Customize what confine says when a moderation command runs.

## Overview

Every punishment command has a default confirmation message. Invoke lets you replace it — both the response posted in the channel and the DM sent to the punished member.

<Info>
  Requires the **Manage Server** permission.
</Info>

## Setting a command response

This is what confine posts in the channel where the command was run.

<CodeGroup>
  ```javascript Syntax theme={null}
  ,invoke (command) (message)
  ```

  ```javascript Example theme={null}
  ,invoke ban {user.name} has been removed by {moderator.name}
  ```
</CodeGroup>

## Setting a DM response

Add `dm` before the command name to configure what the punished member receives privately.

<CodeGroup>
  ```javascript Syntax theme={null}
  ,invoke dm (command) (message)
  ```

  ```javascript Example theme={null}
  ,invoke dm ban you were banned from {guild.name} for: {reason}
  ```
</CodeGroup>

<Tip>
  Both accept full embed syntax. Start your script with `{embed}` to build a rich embed instead of plain text — see [Embed Scripting](/resources/scripting).
</Tip>

## Supported commands

<Tabs>
  <Tab title="Bans">
    `ban` · `hardban` · `softban` · `tempban` · `unban`
  </Tab>

  <Tab title="Mutes">
    `mute` · `unmute` · `imute` · `iunmute` · `rmute` · `runmute`
  </Tab>

  <Tab title="Other">
    `kick` · `warn` · `jail` · `unjail` · `timeout` · `untimeout`
  </Tab>
</Tabs>

<Warning>
  `imute`, `iunmute`, `rmute`, and `runmute` don't support DM responses — channel responses only.
</Warning>

## Variables

| Variable      | Resolves to                                |
| ------------- | ------------------------------------------ |
| `{user}`      | The punished member                        |
| `{moderator}` | Whoever ran the command                    |
| `{reason}`    | The reason given                           |
| `{duration}`  | Length of the punishment, where applicable |
| `{guild}`     | Your server                                |
| `{channel}`   | The channel the command ran in             |

Sub-properties like `{user.name}` and `{moderator.mention}` work the same way they do elsewhere in confine's scripting.

## Previewing

Check what's currently configured before it goes live.

<CodeGroup>
  ```javascript Syntax theme={null}
  ,invoke preview (command)
  ```

  ```javascript Example theme={null}
  ,invoke preview ban
  ,invoke preview dm ban
  ```
</CodeGroup>

## Resetting to default

Pass `default` as the message to clear your custom script.

```javascript theme={null}
,invoke ban default
,invoke dm ban default
```

## Limits

Confine validates your script against Discord's limits before saving, so you'll get a clear error rather than a silent failure later:

| Element           | Max              |
| ----------------- | ---------------- |
| Message content   | 2,000 characters |
| Embed title       | 256              |
| Embed description | 4,096            |
| Embed author      | 256              |
| Embed footer      | 2,048            |
| Field name        | 256              |
| Field value       | 1,024            |
| Fields per embed  | 25               |
| Embed total       | 6,000 characters |
| Buttons           | 25               |

<Info>
  Attachments aren't supported — paste your script directly into the command.
</Info>
