---
name: discord-manage-channel
description: Manage and update Discord channels via the Discord API. Use this skill when the user wants to modify channel properties, update names/topics, change permissions, or delete channels.
---

# Discord Manage Channel

Manage and update Discord channels using the Discord API v10. This skill supports modifying channel properties including name, topic, position, permissions, and deleting channels.

## When to Use This Skill

Use this skill when the user wants to:

- Rename a Discord channel
- Update a channel's topic/description
- Change channel permissions
- Move a channel to a different category
- Reorder channel positions
- Toggle NSFW status
- Update voice channel settings (user limit, bitrate)
- Delete a channel

## Prerequisites

- `DISCORD_BOT_TOKEN` environment variable must be set
- Bot must be a member of the target server
- Bot must have "Manage Channels" permission in the server
- Valid Discord channel ID (18-19 digit snowflake ID)

## API Requests

### Update Channel (PATCH)

```bash
curl -X PATCH "https://discord.com/api/v10/channels/{CHANNEL_ID}" \
  -H "Authorization: Bot ${DISCORD_BOT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "new-channel-name",
    "topic": "New channel topic"
  }'
```

### Delete Channel (DELETE)

```bash
curl -X DELETE "https://discord.com/api/v10/channels/{CHANNEL_ID}" \
  -H "Authorization: Bot ${DISCORD_BOT_TOKEN}"
```

**WARNING:** Channel deletion is permanent and cannot be undone.

## Updatable Properties

### Text Channels

| Property | Type | Description | Validation |
|----------|------|-------------|------------|
| name | string | Channel name | 2-100 chars, lowercase, hyphens/underscores |
| topic | string | Channel topic | Max 1024 characters |
| position | integer | Sort position | Positive integer |
| parent_id | snowflake | Category ID | Valid category ID or null |
| nsfw | boolean | NSFW status | true or false |
| permission_overwrites | array | Permission overrides | Array of permission objects |

### Voice Channels

| Property | Type | Description | Validation |
|----------|------|-------------|------------|
| name | string | Channel name | 2-100 chars |
| position | integer | Sort position | Positive integer |
| parent_id | snowflake | Category ID | Valid category ID or null |
| user_limit | integer | Max users | 0-99 (0 = unlimited) |
| bitrate | integer | Audio quality | 8000-96000 (higher for boosted) |
| permission_overwrites | array | Permission overrides | Array of permission objects |

## Common Operations

### Rename Channel
```json
{ "name": "new-channel-name" }
```

### Update Topic
```json
{ "topic": "New channel description or topic" }
```

### Move to Category
```json
{ "parent_id": "123456789012345678" }
```

### Remove from Category
```json
{ "parent_id": null }
```

### Toggle NSFW
```json
{ "nsfw": true }
```

### Update Voice Settings
```json
{ "user_limit": 10, "bitrate": 64000 }
```

## Permission Overwrites

```json
{
  "permission_overwrites": [
    {
      "id": "role_or_user_id",
      "type": 0,
      "allow": "1024",
      "deny": "2048"
    }
  ]
}
```

- `id`: Role ID or User ID
- `type`: 0 for role, 1 for user
- `allow`: Bitwise permission value (permissions to grant)
- `deny`: Bitwise permission value (permissions to deny)

### Common Permission Bits

| Value | Permission |
|-------|------------|
| 1024 (0x400) | VIEW_CHANNEL |
| 2048 (0x800) | SEND_MESSAGES |
| 4096 (0x1000) | SEND_TTS_MESSAGES |
| 8192 (0x2000) | MANAGE_MESSAGES |
| 16384 (0x4000) | EMBED_LINKS |
| 32768 (0x8000) | ATTACH_FILES |
| 65536 (0x10000) | READ_MESSAGE_HISTORY |
| 1048576 (0x100000) | CONNECT (voice) |
| 2097152 (0x200000) | SPEAK (voice) |

## Rate Limiting

- Channel updates use a shared rate limit bucket
- Limit: 5 requests per 5 seconds per channel
- For bulk updates, add delays between requests
- Wait 1 second between sequential channel updates

## Error Handling

| Code | Error | Solution |
|------|-------|----------|
| 400 | Bad Request - Invalid Name | Ensure channel name is 2-100 chars |
| 403 | Forbidden - Missing Permissions | Bot needs "Manage Channels" permission |
| 404 | Not Found - Channel Doesn't Exist | Verify channel ID is correct |

## API Reference

- Update Endpoint: `PATCH /channels/{channel.id}`
- Delete Endpoint: `DELETE /channels/{channel.id}`
- Discord API Version: v10
- Documentation: https://discord.com/developers/docs/resources/channel#modify-channel
