Skip to main content

Delete Channel

Deletes a Discord channel from a server.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Client Id - The Discord bot client identifier from the Connect node (optional if Bot Token provided).
  • Channel Id - The ID of the Discord channel to delete.

Options

  • Bot Token - Discord bot token credential (optional if using Client ID from Connect node).

How It Works

The Delete Channel node permanently removes a channel from a Discord server. When executed, the node:

  1. Authenticates using either Client ID or direct bot token
  2. Validates the channel ID
  3. Sends a delete channel request to Discord API
  4. Permanently removes the channel and all its contents

Requirements

  • Active Discord bot session (Client ID) or bot token credentials
  • Valid channel ID
  • Manage Channels permission in the server
  • The bot must be a member of the server

Error Handling

The node will return specific errors in the following cases:

  • ErrInvalidArg - Client ID or bot token missing/invalid
  • ErrInvalidArg - Channel ID is empty
  • Discord API errors (missing permissions, channel not found, etc.)
warning

Deleting a channel is permanent and cannot be undone. All messages, files, and settings in the channel will be lost.

Example: Delete Temporary Channel

Inputs:

  • Client Id: (from Connect node)
  • Channel Id: "123456789012345678"

Result: The channel is permanently deleted.

Example: Cleanup Old Channels

Flow:

1. Get list of channels (via Discord API or stored data)
2. For each channel:
- Check if channel is old/inactive
- If True:
- Delete Channel
- Channel Id: {{channel.id}}

Result: Automatically clean up unused channels.

Example: Event Channel Lifecycle

Flow:

1. Create Channel → channel_id (for an event)
2. Use channel during event
3. After event ends:
- Delete Channel
- Channel Id: {{channel_id}}

Result: Temporary event channels are automatically removed.

Use Cases

  • Temporary channels - Remove event or project channels when done
  • Cleanup automation - Regularly clean up unused channels
  • Channel rotation - Delete and recreate channels to clear history
  • Error recovery - Remove incorrectly created channels
  • Ticket systems - Delete resolved support ticket channels
  • Testing - Clean up test channels automatically

What Gets Deleted

When a channel is deleted:

  • All messages in the channel
  • All pinned messages
  • Channel settings and permissions
  • Webhooks configured for the channel
  • The channel history (irreversible)

Bot Permissions Required

  • Manage Channels - Required to delete channels

Safety Considerations

  • Verify before deleting - Double-check the channel ID
  • Backup important data - Export messages if needed before deletion
  • User notification - Inform users before deleting active channels
  • Permission checks - Ensure the channel can be deleted
  • Testing - Test deletion logic in a development server first

Rate Limits

Discord has rate limits for channel operations:

  • Deleting many channels quickly may hit rate limits
  • Consider adding delays between deletions in loops

Tips and Best Practices

  • Confirmation - Add confirmation steps before deletion
  • Logging - Log which channels were deleted for audit trails
  • Archiving - Consider archiving instead of deleting for important channels
  • Error handling - Handle cases where channel is already deleted
  • Permissions - Verify bot has Manage Channels permission
  • User impact - Consider user experience before deleting active channels