Skip to content

Channel

Implementation of a discord Channel as a luau builder.

https://discord.com/developers/docs/resources/guild#create-guild-channel

Properties

id

Channel.id  :: string?

The id of the channel.

name

Channel.name  :: string?

The name of the channel.

type

Channel.type  :: apiTypes.ChannelType

The type of the channel.

position

Channel.position  :: number?

Position of the channel in the list.

icon

Channel.icon  :: string?

The base64 icon for the channel (used in DMs).

flags

Channel.flags  :: number?

Bitfield flags for the channel.

topic

Channel.topic  :: string?

The topic of the text channel.

rateLimitPerUser

Channel.rateLimitPerUser  :: number?

Slowmode in seconds for users.

parentId

Channel.parentId  :: string?

Parent category ID.

nsfw

Channel.nsfw  :: boolean?

Whether the channel is marked as NSFW.

defaultAutoArchiveDuration

Channel.defaultAutoArchiveDuration  :: number?

Default auto archive duration in minutes.

defaultThreadRateLimitPerUser

Channel.defaultThreadRateLimitPerUser  :: number?

Slowmode in seconds for thread messages.

defaultReactionEmoji

Channel.defaultReactionEmoji  :: apiTypes.DefaultReactionObject?

Default reaction emoji object.

availableTags

Channel.availableTags  :: { apiTypes.ForumTagObject }?

Available forum tags.

defaultSortOrder

Channel.defaultSortOrder  :: apiTypes.ForumSortOrder?

Default sort order for threads.

defaultForumLayout

Channel.defaultForumLayout  :: apiTypes.ForumLayout?

Default forum layout type.

videoQualityMode

Channel.videoQualityMode  :: apiTypes.VideoQualityMode?

Voice channel video quality mode.

rtcRegion

Channel.rtcRegion  :: string?

Voice region id for the channel.

userLimit

Channel.userLimit  :: number?

Maximum number of users allowed in the voice channel.

bitrate

Channel.bitrate  :: number?

Bitrate of the voice channel in bits.

Methods

The Channel instance has no set methods!

Functions

setName

Channel . setName (

     self: Channel
     tagName: string
)  -> ()

Set the name of this Channel

setType

Channel . setType (

     self: Channel
     channelType: apiTypes.ChannelType
)  -> ()

Set the Type of channel this is.

setPosition

Channel . setPosition (

     self: Channel
     channelPosition: number
)  -> ()

Sets the position of the channel in the discord channels list. Channels with the same position are sorted by id.

setOverwrites

Channel . setOverwrites (

     self: Channel
     overwriteObjects: { apiTypes.OverwriteObject }
)  -> ()

Adds an overwrite object to the channel’s permission overwrites. Channel overwrites are responsible for handling user/role permission on a specific channel.

setTopic

Channel . setTopic (

     self: Channel
     channelTopic: string
)  -> ()

Sets the channels topic, topics appear at the top of the discord app and help to inform players about the channel’s purpose.

setBitrate

Channel . setBitrate (

     self: Channel
     bitrate: number
)  -> ()

Sets the bitrate of the voice channel, the bitrate (in bits) of the voice or stage channel.

setUserLimit

Channel . setUserLimit (

     self: Channel
     userLimit: number?
)  -> ()

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.

setRateLimitPerUser

Channel . setRateLimitPerUser (

     self: Channel
     rateLimitPerUser: number?
)  -> ()

Amount of seconds a user has to wait before sending another message. Bots and users with certain permissions are unaffected.

setParentId

Channel . setParentId (

     self: Channel
     parentId: apiTypes.Snowflake?
)  -> ()

Set the parent of the channel. Channel parents are categories and can help organize a discord guild.

setNSFW

Channel . setNSFW (

     self: Channel
     isNSFW: boolean
)  -> ()

Set whether this channel is NSFW or not.

setVoiceRegion

Channel . setVoiceRegion (

     self: Channel
     voiceRegionId: string
)  -> ()

Set the voice region (requires querying voice region ids). Voice regions are regions that Discord uses to host voice channels.

setVideoQualityMode

Channel . setVideoQualityMode (

     self: Channel
     videoQualityMode: apiTypes.VideoQualityMode
)  -> ()

Sets the video quality mode of the voice channel.

setDefaultAutoArchiveDuration

Channel . setDefaultAutoArchiveDuration (

     self: Channel
     autoArchiveDuration: number
)  -> ()

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.

setDefaultReactionEmoji

Channel . setDefaultReactionEmoji (

     self: Channel
     defaultReactionEmoji: apiTypes.DefaultReactionObject
)  -> ()

Sets the default reaction emoji for either a forum or media channel.

setForumTags

Channel . setForumTags (

     self: Channel
     forumTags: { apiTypes.ForumTagObject }
)  -> ()

Specify channel forum tags that are available to the channel.

setDefaultSortOrder

Channel . setDefaultSortOrder (

     self: Channel
     sortOrder: apiTypes.ForumSortOrder
)  -> ()

Sets the default sort order for the channel.

setDefaultForumLayout

Channel . setDefaultForumLayout (

     self: Channel
     forumLayout: apiTypes.ForumLayout
)  -> ()

Sets the default forum layout for the channel.

setDefaultThreadRateLimitPerUser

Channel . setDefaultThreadRateLimitPerUser (

     self: Channel
     threadRateLimitPerUser: number
)  -> ()

Sets the default thread rate limit per user for the channel.

setFlags

Channel . setFlags (

     self: Channel
     bitflags: number
)  -> ()

Sets the channel flags using a bitfield value.

setIcon

Channel . setIcon (

     self: Channel
     iconData: string
)  -> ()

Sets the channel icon using the provided icon data.

build

Channel . build (

     self: Channel
)  -> ()

Responsible for building the channel object that the Discord API can understand.

new

Channel . new (

     resource: {
       channelName: string?,
       channelType: apiTypes.ChannelType?,
       channelPosition: number?,
       channelPermissionOverwrites: { apiTypes.OverwriteObject,
    }
)  -> ()

Constructor for the Discord Channel Builder.