# Leave Server

<figure><img src="/files/Xic5vwyKpA26tvGkAlG3" alt=""><figcaption></figcaption></figure>

With the "Leave Server" action you can force the bot to leave a server. Please note this action cannot be undone and the bot will need to be re-invited to rejoin the server, so consider adding a confirmation step before using this action.

## Target Server

<figure><img src="/files/mY9vVtnKbc7ktzojLwYP" alt=""><figcaption></figcaption></figure>

This dropdown menu is the channel target for the server invite. You will only have two options to choose from.

{% tabs %}
{% tab title="Current Server" %}
If this type is selected, the bot will leave the server where the command has been ran.&#x20;
{% endtab %}

{% tab title="Server ID" %}
If this type is selected, the bot will leave the server entered in the field below by ID or variable.&#x20;

## Server ID

<figure><img src="/files/NAIpy1YuqiRZc0qFQ4Ws" alt=""><figcaption></figcaption></figure>

In this field you can enter the server ID or variable of the server that you want to leave with the bot.&#x20;
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.botghost.com/custom-commands-and-events/actions/server-actions/leave-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
