Skip to content

channel_create

channel_create adds a new channel at the end of the channel list. Use channel_move afterwards to place it.

{
"cmd": "channel_create",
"name": "announcements",
"type": "text",
"display_name": "Announcements",
"description": "News from the team",
"permissions": {
"send": ["admin"]
},
"slow_mode_cooldown": 10
}
Field Type Required Description
name string Yes Unique channel ID used by every other command. Trimmed, then 1 to 64 characters. Can’t be . or .. or contain /.
type string Yes text, voice, forum, or separator.
display_name string No Name to show in the UI instead of name. An empty string is ignored.
description string No Channel topic. An empty string is ignored.
icon string or null No Absolute http or https URL of an icon image, with no whitespace. Leave it out or send null for no icon.
permissions object No Map from channel permission to the roles allowed to use it. Keys you leave out use the server defaults. See roles and permissions.
size number No Separator size. Stored only for separators; clients decide how to draw it.
max_message_age number No Message retention in seconds, rounded down. 0 means no limit. The server stores and returns it but does not delete old messages itself.
slow_mode_cooldown number No Seconds each user must wait between messages. Rounded down. 0 turns slow mode off. Admins and users with manage_server are exempt.

Channel types:

  • text: an ordinary chat channel.
  • voice: a voice channel that also has a text chat.
  • forum: holds threads. Messages can only be posted inside a thread.
  • separator: a heading or divider in the channel list. It has no messages.
{ "cmd": "channel_create", "val": true }

Before this reply, every logged-in connection, including yours, receives a fresh channels_get list. The change is also recorded in the audit log.

Requires the manage_channels server permission. Without it the server returns Access denied: 'manage_channels' permission required. A user in a timeout gets a rate_limit frame instead.

val When
Channel name must be at most 64 characters name is too long after trimming.
Channel name cannot contain path separators name is ., .., or contains /.
Channel icon must be an absolute HTTP or HTTPS URL icon is not a valid web URL.
Channel already exists A channel with this exact name exists.
Failed to create channel '<name>' The server could not save the channel, or leftover data for this name is still on disk.

A validation message is returned when name is missing or empty, type is not one of the four types, or another field has the wrong type or a negative duration.