Skip to content

Channel

Implementation of a discord Channel as a luau builder.

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

Summary

Channel.permissionOverwrites  :: OverwriteObject }

List of permission overwrites applied to the channel.

Channel.id  :: string?

The id of the channel.

Channel.name  :: string?

The name of the channel.

Channel.type  :: ChannelType

The type of the channel.

Channel.position  :: number?

Position of the channel in the list.

Channel.icon  :: string?

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

Channel.flags  :: number?

Bitfield flags for the channel.

Channel.topic  :: string?

The topic of the text channel.

Channel.rateLimitPerUser  :: number?

Slowmode in seconds for users.

Channel.parentId  :: string?

Parent category ID.

Channel.nsfw  :: boolean?

Whether the channel is marked as NSFW.

Channel.defaultAutoArchiveDuration  :: number?

Default auto archive duration in minutes.

Channel.defaultThreadRateLimitPerUser  :: number?

Slowmode in seconds for thread messages.

Channel.defaultReactionEmoji  :: DefaultReactionObject?

Default reaction emoji object.

Channel.availableTags  :: ForumTagObject }?

Available forum tags.

Channel.defaultSortOrder  :: ForumSortOrder?

Default sort order for threads.

Channel.defaultForumLayout  :: ForumLayout?

Default forum layout type.

Channel.videoQualityMode  :: VideoQualityMode?

Voice channel video quality mode.

Channel.rtcRegion  :: string?

Voice region id for the channel.

Channel.userLimit  :: number?

Maximum number of users allowed in the voice channel.

Channel.bitrate  :: number?

Bitrate of the voice channel in bits.

Channel : setName ( tagName )  -> Channel

Set the name of this Channel

Parameters

tagName: string

Returns

Channel
Channel : setType ( channelType )  -> Channel

Set the Type of channel this is.

Parameters

channelType: ChannelType

Returns

Channel
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
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
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
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
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
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
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
Channel : setNSFW ( isNSFW )  -> Channel

Set whether this channel is NSFW or not.

Parameters

isNSFW: boolean

Returns

Channel
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
Channel : setVideoQualityMode ( videoQualityMode )  -> Channel

Sets the video quality mode of the voice channel.

Parameters

videoQualityMode: VideoQualityMode

Returns

Channel
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
Channel : setDefaultReactionEmoji ( defaultReactionEmoji )  -> Channel

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

Parameters

defaultReactionEmoji: DefaultReactionObject

Returns

Channel
Channel : setForumTags ( forumTags )  -> Channel

Specify channel forum tags that are available to the channel.

Parameters

forumTags: ForumTagObject }

Returns

Channel
Channel : setDefaultSortOrder ( sortOrder )  -> Channel

Sets the default sort order for the channel.

Parameters

sortOrder: ForumSortOrder

Returns

Channel
Channel : setDefaultForumLayout ( forumLayout )  -> Channel

Sets the default forum layout for the channel.

Parameters

forumLayout: ForumLayout

Returns

Channel
Channel : setDefaultThreadRateLimitPerUser ( threadRateLimitPerUser )  -> Channel

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

Parameters

threadRateLimitPerUser: number

Returns

Channel
Channel : setFlags ( bitflags )  -> Channel

Sets the channel flags using a bitfield value.

Parameters

bitflags: number

Returns

Channel
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
Channel . new ( resource )  -> Channel

Constructor for the Discord Channel Builder.

Parameters

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

Returns

Channel