> For the complete documentation index, see [llms.txt](https://documentation.botghost.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.botghost.com/custom-commands-and-events/actions/channel-actions/delete-a-channel.md).

# Delete a channel

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

This action block will delete any channel input, in any server the bot is in.

{% hint style="warning" %}
Warning: Your bot must have Manage Channel Permission to be able to Delete a channel.
{% endhint %}

## **Channel**

This dropdown is where you can choose which method to target the channel that you need deleted.

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

{% tabs %}
{% tab title="Specific Channel" %}
This type when selected will make a new dropdown appear for where you can choose which specific channel from a server to delete.

### Specific Channel

This is the dropdown as seen below. "Command Options" is where you can choose options from the command to be deleted. In this case it would delete a channel selected from the channel option.

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

**Note: If you don't see the channel you wish for, click the refresh icon next to the title.**
{% endtab %}

{% tab title="Channel ID or Variable" %}
This selection will target a specific channel ID or [variable](/custom-commands-and-events/variables.md) to delete.&#x20;

### Channel ID or Variable

This field is where you input a plain channel ID or a [variable](/custom-commands-and-events/variables.md) that returns a plain channel ID.\
The ID must have no extra symbols or spaces.&#x20;

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

<figure><img src="/files/Z96BOL2abBGUR2r4FVAE" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Enable Success/Error Handles

Enable Success / Error Handles to detect success and errors inside of the action block. This allows you to run different actions if something goes wrong with your action. Inside of the handle, there are 2 different paths which are used to detect the outcome of the action. The green path on the bottom left side of the block indicates success, while the red path on the bottom right side of the block indicates error. You may attach action blocks to each side of the handle to get the outcome of your action block.

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

The Success/Error Handles feature includes 3 different error variables you can use to get information on why the action block encountered an error. Check them out [here](/custom-commands-and-events/variables.md#error-variables).

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://documentation.botghost.com/custom-commands-and-events/actions/channel-actions/delete-a-channel.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
