Moderation
createChannel
$createChannel
The $createChannel[] function creates a new channel on the Discord server.
Syntax
$createChannel[name;type;(categoryID)]
Parameters
| Parameter | Description |
|---|---|
name |
Required. Name of the channel (1 to 100 characters). |
type |
Required. One of text, voice, category, stage, forum (case-insensitive). Any other value raises Invalid BDFD channel type. |
categoryID |
Optional. ID of the parent category. It must be a category of the current server; a category cannot itself have a parent (Categories cannot have a parent category.). If the argument is written, it cannot be empty (Invalid channel ID.); omit it for no parent. |
Return value
- Type: String
- An empty string. The function does not return the ID of the created channel.
- If the bot lacks the permission or the arguments are invalid, the function raises an error.
Behavior
- The bot must have the
Manage Channelspermission. - The channel is created in the current server.
- The ID of the new channel is not returned; to find it afterwards, use
$channelID[name]or$findChannel[name].
Examples
Log channel
$createChannel[logs-bot;text;123456789]
$sendMessage[Log channel created.]
Dynamic ticket channel
$createChannel[ticket-$username;text;123456789]
$sendMessage[Ticket channel created.]
Category + channels
$createChannel[New Project;category]
$createChannel[discussion;text;$categoryID[New Project]]
$createChannel[Voice;voice;$categoryID[New Project]]
$sendMessage[Category and channels created!]
Notes
- To delete, use
$deleteChannels[].
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.