Channel
Implementation of a discord Channel as a luau builder.
https://discord.com/developers/docs/resources/guild#create-guild-channel
Summary
Properties
Channel.permissionOverwrites :: { Builders.OverwriteObject }Channel.id :: string?Channel.name :: string?Channel.type :: apiTypes.ChannelTypeChannel.position :: number?Channel.icon :: string?Channel.flags :: number?Channel.topic :: string?Channel.rateLimitPerUser :: number?Channel.parentId :: string?Channel.nsfw :: boolean?Channel.defaultAutoArchiveDuration :: number?Channel.defaultThreadRateLimitPerUser :: number?Channel.defaultReactionEmoji :: apiTypes.DefaultReactionObject?Channel.availableTags :: { apiTypes.ForumTagObject }?Channel.defaultSortOrder :: apiTypes.ForumSortOrder?Channel.defaultForumLayout :: apiTypes.ForumLayout?Channel.videoQualityMode :: apiTypes.VideoQualityMode?Channel.rtcRegion :: string?Channel.userLimit :: number?Channel.bitrate :: number?Methods
Channel:setName(tagName: string) → ChannelChannel:setType(channelType: apiTypes.ChannelType) → ChannelChannel:setPosition(channelPosition: number) → ChannelChannel:setOverwrites(overwriteObjects: { apiTypes.OverwriteObject }) → ChannelChannel:setTopic(channelTopic: string) → ChannelChannel:setBitrate(bitrate: number) → ChannelChannel:setUserLimit(userLimit: number?) → ChannelChannel:setRateLimitPerUser(rateLimitPerUser: number?) → ChannelChannel:setParentId(parentId: apiTypes.Snowflake?) → ChannelChannel:setNSFW(isNSFW: boolean) → ChannelChannel:setVoiceRegion(voiceRegionId: string) → ChannelChannel:setVideoQualityMode(videoQualityMode: apiTypes.VideoQualityMode) → ChannelChannel:setDefaultAutoArchiveDuration(autoArchiveDuration: number) → ChannelChannel:setDefaultReactionEmoji(defaultReactionEmoji: apiTypes.DefaultReactionObject) → ChannelChannel:setForumTags(forumTags: { apiTypes.ForumTagObject }) → ChannelChannel:setDefaultSortOrder(sortOrder: apiTypes.ForumSortOrder) → ChannelChannel:setDefaultForumLayout(forumLayout: apiTypes.ForumLayout) → ChannelChannel:setDefaultThreadRateLimitPerUser(threadRateLimitPerUser: number) → ChannelChannel:setFlags(bitflags: number) → ChannelChannel:setIcon(iconData: string) → ChannelChannel:build() → JSONProperties
Section titled “Properties”permissionOverwrites
Section titled “permissionOverwrites”List of permission overwrites applied to the channel.
The id of the channel.
The name of the channel.
The type of the channel.
position
Section titled “position”Position of the channel in the list.
The base64 icon for the channel (used in DMs).
Bitfield flags for the channel.
The topic of the text channel.
rateLimitPerUser
Section titled “rateLimitPerUser”Slowmode in seconds for users.
parentId
Section titled “parentId”Parent category ID.
Whether the channel is marked as NSFW.
defaultAutoArchiveDuration
Section titled “defaultAutoArchiveDuration”Default auto archive duration in minutes.
defaultThreadRateLimitPerUser
Section titled “defaultThreadRateLimitPerUser”Slowmode in seconds for thread messages.
defaultReactionEmoji
Section titled “defaultReactionEmoji”Default reaction emoji object.
availableTags
Section titled “availableTags”Available forum tags.
defaultSortOrder
Section titled “defaultSortOrder”Default sort order for threads.
defaultForumLayout
Section titled “defaultForumLayout”Default forum layout type.
videoQualityMode
Section titled “videoQualityMode”Voice channel video quality mode.
rtcRegion
Section titled “rtcRegion”Voice region id for the channel.
userLimit
Section titled “userLimit”Maximum number of users allowed in the voice channel.
bitrate
Section titled “bitrate”Bitrate of the voice channel in bits.
Methods
Section titled “Methods”setName
Section titled “setName”Channel : setName ( tagName ) -> Channel
Set the name of this Channel
Parameters
| tagName: string |
Returns
| Channel |
setType
Section titled “setType”Channel : setType ( channelType ) -> Channel
Set the Type of channel this is.
Parameters
| channelType: ChannelType |
Returns
| Channel |
setPosition
Section titled “setPosition”Channel : setPosition ( channelPosition ) -> Channel
Sets the position of the channel in the discord channels list. Channels with the same position are sorted by id.
Parameters
| channelPosition: number |
Returns
| Channel |
setOverwrites
Section titled “setOverwrites”Channel : setOverwrites ( overwriteObjects ) -> Channel
Adds an overwrite object to the channel’s permission overwrites. Channel overwrites are responsible for handling user/role permission on a specific channel.
Parameters
| overwriteObjects: OverwriteObject } |
Returns
| Channel |
setTopic
Section titled “setTopic”Channel : setTopic ( channelTopic ) -> Channel
Sets the channels topic, topics appear at the top of the discord app and help to inform players about the channel’s purpose.
Parameters
| channelTopic: string |
Returns
| Channel |
setBitrate
Section titled “setBitrate”Channel : setBitrate ( bitrate ) -> Channel
Sets the bitrate of the voice channel, the bitrate (in bits) of the voice or stage channel.
Parameters
| bitrate: number |
Returns
| Channel |
setUserLimit
Section titled “setUserLimit”Channel : setUserLimit ( userLimit ) -> Channel
The user limit of the voice channel. The user limit of a voice channel is the maximum number of users allowed in the channel at one time.
Parameters
| userLimit: number? |
Returns
| Channel |
setRateLimitPerUser
Section titled “setRateLimitPerUser”Channel : setRateLimitPerUser ( rateLimitPerUser ) -> Channel
Amount of seconds a user has to wait before sending another message. Bots and users with certain permissions are unaffected.
Parameters
| rateLimitPerUser: number? |
Returns
| Channel |
setParentId
Section titled “setParentId”Channel : setParentId ( parentId ) -> Channel
Set the parent of the channel. Channel parents are categories and can help organize a discord guild.
Parameters
| parentId: Snowflake? |
Returns
| Channel |
setNSFW
Section titled “setNSFW”Channel : setNSFW ( isNSFW ) -> Channel
Set whether this channel is NSFW or not.
Parameters
| isNSFW: boolean |
Returns
| Channel |
setVoiceRegion
Section titled “setVoiceRegion”Channel : setVoiceRegion ( voiceRegionId ) -> Channel
Set the voice region (requires querying voice region ids). Voice regions are regions that Discord uses to host voice channels.
Parameters
| voiceRegionId: string |
Returns
| Channel |
setVideoQualityMode
Section titled “setVideoQualityMode”Channel : setVideoQualityMode ( videoQualityMode ) -> Channel
Sets the video quality mode of the voice channel.
Parameters
| videoQualityMode: VideoQualityMode |
Returns
| Channel |
setDefaultAutoArchiveDuration
Section titled “setDefaultAutoArchiveDuration”Channel : setDefaultAutoArchiveDuration ( autoArchiveDuration ) -> Channel
Sets the default auto archive duration for the channel. This is the default duration in minutes for newly created threads to automatically archive after recent activity.
Parameters
| autoArchiveDuration: number |
Returns
| Channel |
setDefaultReactionEmoji
Section titled “setDefaultReactionEmoji”Channel : setDefaultReactionEmoji ( defaultReactionEmoji ) -> Channel
Sets the default reaction emoji for either a forum or media channel.
Parameters
| defaultReactionEmoji: DefaultReactionObject |
Returns
| Channel |
setForumTags
Section titled “setForumTags”Channel : setForumTags ( forumTags ) -> Channel
Specify channel forum tags that are available to the channel.
Parameters
| forumTags: ForumTagObject } |
Returns
| Channel |
setDefaultSortOrder
Section titled “setDefaultSortOrder”Channel : setDefaultSortOrder ( sortOrder ) -> Channel
Sets the default sort order for the channel.
Parameters
| sortOrder: ForumSortOrder |
Returns
| Channel |
setDefaultForumLayout
Section titled “setDefaultForumLayout”Channel : setDefaultForumLayout ( forumLayout ) -> Channel
Sets the default forum layout for the channel.
Parameters
| forumLayout: ForumLayout |
Returns
| Channel |
setDefaultThreadRateLimitPerUser
Section titled “setDefaultThreadRateLimitPerUser”Channel : setDefaultThreadRateLimitPerUser ( threadRateLimitPerUser ) -> Channel
Sets the default thread rate limit per user for the channel.
Parameters
| threadRateLimitPerUser: number |
Returns
| Channel |
setFlags
Section titled “setFlags”Channel : setFlags ( bitflags ) -> Channel
Sets the channel flags using a bitfield value.
Parameters
| bitflags: number |
Returns
| Channel |
setIcon
Section titled “setIcon”Channel : setIcon ( iconData ) -> Channel
Sets the channel icon using the provided icon data.
Parameters
| iconData: string |
Returns
| Channel |
Channel : build ( ) -> JSON
Responsible for building the channel object that the Discord API can understand.
Returns
| JSON |
Functions
Section titled “Functions”Channel . new ( resource ) -> Channel
Constructor for the Discord Channel Builder.
Parameters
| resource: { channelName: string?, channelType: apiTypes.ChannelType?, channelPosition: number?, channelPermissionOverwrites: { apiTypes.OverwriteObject, } |
Returns
| Channel |