App Logo
discord.com

delete_channel

Delete a Discord channel by its id — text, voice, announcement, stage or forum. Requires the Manage Channels permission in that server. This cannot be undone: Discord removes the channel together with all of its message history, as its own confirmation dialog warns. Before confirming, the script checks that Discord's confirmation dialog names the very channel that was asked for, so a mis-targeted context menu can never remove the wrong channel, and it refuses outright when the id is a category rather than a channel. Success is taken from Discord's own deletion response, not from the sidebar. Pass expectedName to have the channel's name asserted as well.

Input

guildId required

Server id the channel belongs to, e.g. from discord.com/list_servers.

channelId required

Id of the channel to delete, e.g. from discord.com/list_channels or create_channel's channelId. Must be a channel, not a category — a category id is refused.

expectedName optional

Optional safety check: the channel's name as it appears in the sidebar (from discord.com/list_channels). When given, the script refuses to delete unless the channel at channelId carries exactly this name. Regardless of this argument, the script always verifies that Discord's own confirmation dialog names the channel it resolved.

Output

name required

The channel's name as read from the sidebar before deletion, so the caller has a receipt of what was actually removed.

deleted required

True only when Discord's own DELETE request returned a success status.

guildId required
channelId required
verified_gone required

Whether the channel row was confirmed to have disappeared from the sidebar afterwards. A second check, never the assertion — `deleted` is what Discord's API said.

Start building not clicking