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

# Leave Message

> Send a custom goodbye message when a member leaves your server.

Leave Message sends a customized farewell message to a channel of your choice whenever a member leaves, is kicked, or is banned from your server.

<Note>
  **Required Permission:** [Admin Access](/permissions/admin-access) or higher — Server Owner, Extra Owner, Trusted User, or Administrator with a role above the bot can use these commands.
</Note>

<Warning>
  **Premium Feature:** This module requires an active Premium subscription. If the server's premium expires, the leave message system will be automatically disabled.
</Warning>

## Setting Up

Follow these steps to configure the leave message for your server.

<Steps>
  <Step title="Run the Set Command">
    Provide the channel and your leave message.

    ```bash theme={null}
    .leavemsg set #goodbye {user} has left {servername}. We are now at {servermembercount} members.
    ```

    A preview of the message will be shown before saving.
  </Step>

  <Step title="Test It">
    Send a test message to verify the output.

    ```bash theme={null}
    .leavemsg test
    ```
  </Step>
</Steps>

***

## Commands

| Command                          | Description                                          |
| :------------------------------- | :--------------------------------------------------- |
| `.leavemsg set <channel> <text>` | Sets the leave message and channel                   |
| `.leavemsg show`                 | Shows the current leave message with a live preview  |
| `.leavemsg test`                 | Sends a test leave message to the configured channel |
| `.leavemsg reset`                | Deletes the leave message configuration              |
| `.leavemsg enable`               | Enables the leave message                            |
| `.leavemsg disable`              | Disables the leave message                           |

***

## Customizing Messages

The leave message is fully customizable and supports both **dynamic variables** and **custom embeds**.

### Using Variables

You can dynamically insert information like the user's name or the updated member count. Refer to the [Variables](/resources/variables) reference for the full list.

**Available contexts:** Server, User, Author, Target

<CodeGroup>
  ```bash Input theme={null}
  .leavemsg set #goodbye Goodbye {user}! {servername} now has {servermembercount} members.
  ```

  ```text Output theme={null}
  Goodbye @john_doe! ZEON Official now has 50,209 members.
  ```
</CodeGroup>

### Using Custom Embeds

Design a rich embed using the interactive embed builder, then attach it to your message with the `{embed:name}` syntax.

<Steps>
  <Step title="Create the Embed">
    ```bash theme={null}
    .embed create farewell_card
    ```

    Use the dropdown menu to customize title, description, color, images, and variables.
  </Step>

  <Step title="Attach to Message">
    ```bash theme={null}
    .leavemsg set #goodbye {user} has left. {embed:farewell_card}
    ```
  </Step>
</Steps>

<Note>
  The `{embed:name}` placeholder is invisible in the final output. The bot strips it from the text and attaches the rich embed below the message. Variables placed inside the embed builder will also parse correctly.
</Note>

### Limitations

<Warning>
  * A leave message configuration **must be reset** before setting a new one. Use `.leavemsg reset` first.
  * If the configured channel is deleted, leave messages will silently fail until a new channel is set.
  * The `{user}` variable in leave messages will display the user's **name** rather than a clickable mention, since the member has already left the server.
</Warning>
