---
name: discord-create-channel
description: Create new channels in Discord guilds/servers via the Discord API. Use this skill when the user wants to create text channels, voice channels, announcement channels, or categories in a Discord server.
---

# Discord Create Channel

Create new channels in Discord guilds (servers) using the Discord API v10. This skill supports creating text channels, voice channels, announcement channels, stage channels, and categories.

## When to Use This Skill

Use this skill when the user wants to:

- Create a new text channel in a Discord server
- Create a new voice channel for meetings or discussions
- Create an announcement channel for server updates
- Create a category to organize channels
- Set up a new channel with specific permissions
- Create a stage channel for large audio events

## 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 guild ID (18-19 digit snowflake ID)

## Channel Types

| Type | Value | Description |
|------|-------|-------------|
| GUILD_TEXT | 0 | Text channel |
| GUILD_VOICE | 2 | Voice channel |
| GUILD_CATEGORY | 4 | Category (organizes channels) |
| GUILD_ANNOUNCEMENT | 5 | Announcement channel (one-way communication) |
| GUILD_STAGE_VOICE | 13 | Stage channel (audio events) |

## Instructions

### 1. Validate Requirements

- Confirm `DISCORD_BOT_TOKEN` is set in environment
- Verify guild ID is provided (18-19 digit number)
- Ensure channel name is valid (2-100 characters, lowercase, hyphens/underscores only)
- Determine channel type (default to text channel if not specified)

### 2. Prepare Channel Properties

- `name`: Channel name (required, 2-100 chars)
- `type`: Channel type (0=text, 2=voice, 4=category, 5=announcement, 13=stage)
- `topic`: Channel topic/description (optional, max 1024 chars for text channels)
- `parent_id`: Category ID to place channel in (optional)
- `nsfw`: Whether channel is NSFW (optional, default false)
- `position`: Sort position (optional)
- `permission_overwrites`: Permission overrides (optional, array)

### 3. Make the API Request

```bash
curl -X POST "https://discord.com/api/v10/guilds/{GUILD_ID}/channels" \
  -H "Authorization: Bot ${DISCORD_BOT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "channel-name",
    "type": 0
  }'
```

## Creating Different Channel Types

### Text Channel (Type 0)
```json
{
  "name": "general-chat",
  "type": 0,
  "topic": "General discussion for all members"
}
```

### Voice Channel (Type 2)
```json
{
  "name": "voice-lounge",
  "type": 2,
  "user_limit": 10
}
```

### Category (Type 4)
```json
{
  "name": "Community",
  "type": 4
}
```

### Announcement Channel (Type 5)
```json
{
  "name": "server-updates",
  "type": 5,
  "topic": "Official server announcements"
}
```

## Setting Channel in Category

```json
{
  "name": "new-channel",
  "type": 0,
  "parent_id": "123456789012345678"
}
```

## Channel Permissions

```json
{
  "name": "private-channel",
  "type": 0,
  "permission_overwrites": [
    {
      "id": "role_id_here",
      "type": 0,
      "allow": "1024",
      "deny": "0"
    }
  ]
}
```

Permission types:
- `type: 0` = Role
- `type: 1` = Member

Common permission values:
- 1024 = View Channel
- 2048 = Send Messages
- 8192 = Read Message History
- 65536 = Mention Everyone

## Error Handling

| Code | Error | Solution |
|------|-------|----------|
| 400 | Bad Request - Invalid Name | Ensure channel name is 2-100 characters and follows naming rules |
| 403 | Forbidden - Missing Permissions | Bot needs "Manage Channels" permission in the server |
| 404 | Not Found - Invalid Guild | Verify guild ID is correct and bot is member of the server |

## API Reference

- Endpoint: `POST /guilds/{guild.id}/channels`
- Discord API Version: v10
- Documentation: https://discord.com/developers/docs/resources/guild#create-guild-channel
