createChannel

General

createChannel creates a new channel in the guild.


Usage

Client:createChannel(<string> name, (array) options)
Returns: <Channel> channel

Options may contain:
(string) type - Type of the channel.
(string) name - The name of the channel.
(number) position - The position visible to the user
(string) topic - The topic of the channel, use only when the type of channel is text.
(boolean) nsfw - The NSFW setting for the channel, use only when the type of channel is text.
(number) bitrate - The bitrate of the voice channel.
(number) userLimit - The maximum amount of users to contain in a voice channel.
(string) parent - The ID of the parent category channel.
(array) permissionOverwrites - The permission to overwrite, see permissionOverwrites.
(number) rateLimitPerUser - Sets the slowmode message limit in the text channel.


Limitations

See discordChannel POST.


Example

local channel = Client:createChannel("TestChannel", { type = "text" })
print(channel.name)

createChannel.PNG

Back to top