LogoAntiRaid

@discord-types/builders/channel

API reference for @discord-types/builders/channel

@discord-types/builders/channel

Types

Channel

Raw Type
type Channel = Channel.Prototype, & {
	id: apiTypes.Snowflake?,

	name: string?,

	type: channelTypes.ChannelType,

	permissionOverwrites: {apiTypes.OverwriteObject},

	position: number?,

	-- DM
	icon: string?,

	flags: number?,

	-- TEXT
	topic: string?,

	rateLimitPerUser: number?,

	parentId: apiTypes.Snowflake?,

	nsfw: boolean?,

	defaultAutoArchiveDuration: number?,

	defaultThreadRateLimitPerUser: number?,

	-- MEDIA
	defaultReactionEmoji: apiTypes.DefaultReactionObject?,

	availableTags: {apiTypes.ForumTagObject}?,

	defaultSortOrder: channelTypes.ForumSortOrder?,

	-- FORUM
	defaultForumLayout: channelTypes.ForumLayout?,

	-- VOICE
	videoQualityMode: channelTypes.VideoQualityMode?,

	rtcRegion: string?,

	userLimit: number?,

	bitrate: number?
}

Intersection with variants:

Variant 2
PropTypeDescription
id?
-
name?
-
type
-
permissionOverwrites
-
position?
-
icon?
-
flags?
-
topic?
-
rateLimitPerUser?
-
parentId?
-
nsfw?
-
defaultAutoArchiveDuration?
-
defaultThreadRateLimitPerUser?
-
defaultReactionEmoji?
-
availableTags?
-
defaultSortOrder?
-
defaultForumLayout?
-
videoQualityMode?
-
rtcRegion?
-
userLimit?
-
bitrate?
-

JSON

Raw Type
type JSON = Channel.Prototype.build(nil :: any),

Functions

Channel.Prototype.setName

[[ Set the name of this Channel ]]

Function Signature
--[[
	Set the name of this Channel
]]
function Channel.Prototype.setName(self: Channel, tagName: string) -> Channel end

Arguments

tagName

string

Returns

ret1

Channel

Channel.Prototype.setType

[[ Set the Type of channel this is. ]]

Function Signature
--[[
	Set the Type of channel this is.
]]
function Channel.Prototype.setType(self: Channel, channelType: channelTypes.ChannelType) -> Channel end

Arguments

channelType

channelTypes.ChannelType

Returns

ret1

Channel

Channel.Prototype.setPosition

[[ Sets the position of the channel in the discord channels list.

channels with the same position are sorted by id ]]

Function Signature
--[[
	Sets the position of the channel in the discord channels list.

	channels with the same position are sorted by id
]]
function Channel.Prototype.setPosition(self: Channel, channelPosition: number) -> Channel end

Arguments

channelPosition

number

Returns

ret1

Channel

Channel.Prototype.setOverwrites

[[ Adds an overwrite object to the channel's permission overwrites.

channel overwrites are responsible for handling user/role permission on a specific channel. ]]

Function Signature
--[[
	Adds an overwrite object to the channel's permission overwrites.

	channel overwrites are responsible for handling user/role permission on a specific channel.
]]
function Channel.Prototype.setOverwrites(self: Channel, overwriteObjects: {apiTypes.OverwriteObject}) -> Channel end

Arguments

overwriteObjects

{apiTypes.OverwriteObject}

Returns

ret1

Channel

Channel.Prototype.setTopic

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

Function Signature
--[[
	Sets the channels topic, topics appear at the top of the discord app and help to inform players about
		the channel's purpose.
]]
function Channel.Prototype.setTopic(self: Channel, channelTopic: string) -> Channel end

Arguments

channelTopic

string

Returns

ret1

Channel

Channel.Prototype.setBitrate

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

Function Signature
--[[
	Sets the bitrate of the voice channel, the bitrate (in bits) of the voice or stage channel.
]]
function Channel.Prototype.setBitrate(self: Channel, bitrate: number) -> Channel end

Arguments

bitrate

number

Returns

ret1

Channel

Channel.Prototype.setUserLimit

[[ 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. ]]

Function Signature
--[[
	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.
]]
function Channel.Prototype.setUserLimit(self: Channel, userLimit: number?) -> Channel end

Arguments

userLimit

This field is optional and may not be specified

number?

Returns

ret1

Channel

Channel.Prototype.setRateLimitPerUser

[[ amount of seconds a user has to wait before sending another message; bots, as well as users with the permission manage_messages or manage_channel, are unaffected ]]

Function Signature
--[[
	amount of seconds a user has to wait before sending another message; bots, as well as users with
		the permission manage_messages or manage_channel, are unaffected
]]
function Channel.Prototype.setRateLimitPerUser(self: Channel, rateLimitPerUser: number?) -> Channel end

Arguments

rateLimitPerUser

This field is optional and may not be specified

number?

Returns

ret1

Channel

Channel.Prototype.setParentId

[[ set the parent of the channel, channel parents are categories and can help break down a discord guild. ]]

Function Signature
--[[
	set the parent of the channel, channel parents are categories and can help break down a discord guild.
]]
function Channel.Prototype.setParentId(self: Channel, parentId: apiTypes.Snowflake?) -> Channel end

Arguments

parentId

This field is optional and may not be specified

apiTypes.Snowflake?

Returns

ret1

Channel

Channel.Prototype.setNSFW

[[ set weather this channel is NSFW or not. ]]

Function Signature
--[[
	set weather this channel is NSFW or not.
]]
function Channel.Prototype.setNSFW(self: Channel, isNSFW: boolean) -> Channel end

Arguments

isNSFW

boolean

Returns

ret1

Channel

Channel.Prototype.setVoiceRegion

[[ set the voice region (requires you to query for the voice region ids) of the voice channel.

voice regions are regions that discord uses to host voice channels. ]]

Function Signature
--[[
	set the voice region (requires you to query for the voice region ids) of the voice channel.

	voice regions are regions that discord uses to host voice channels.
]]
function Channel.Prototype.setVoiceRegion(self: Channel, voiceRegionId: string) -> Channel end

Arguments

voiceRegionId

string

Returns

ret1

Channel

Channel.Prototype.setVideoQualityMode

[[ sets the video quality mode of the voice channel. ]]

Function Signature
--[[
	sets the video quality mode of the voice channel.
]]
function Channel.Prototype.setVideoQualityMode(self: Channel, videoQualityMode: channelTypes.VideoQualityMode) -> Channel end

Arguments

videoQualityMode

channelTypes.VideoQualityMode

Returns

ret1

Channel

Channel.Prototype.setDefaultAutoArchiveDuration

[[ sets the default auto archive duration for the channel, the default duration that the clients use (not the API) for newly created threads in the channel, in minutes, to automatically archive the thread after recent activity ]]

Function Signature
--[[
	sets the default auto archive duration for the channel, the default duration that the clients use (not the API)
		for newly created threads in the channel, in minutes, to automatically archive the thread after recent activity	
]]
function Channel.Prototype.setDefaultAutoArchiveDuration(self: Channel, autoArchiveDuration: number) -> Channel end

Arguments

autoArchiveDuration

number

Returns

ret1

Channel

Channel.Prototype.setDefaultReactionEmoji

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

This is the default emoji that the channel will use for the forum or media channel. ]]

Function Signature
--[[
	sets the default reaction emoji for either a forum or media channel.

	This is the default emoji that the channel will use for the forum or media channel.
]]
function Channel.Prototype.setDefaultReactionEmoji(self: Channel, defaultReactionEmoji: apiTypes.DefaultReactionObject) -> Channel end

Arguments

defaultReactionEmoji

apiTypes.DefaultReactionObject

Returns

ret1

Channel

Channel.Prototype.setForumTags

[[ specify channel forum tags that are available to the channel.

This is the list of tags that the channel will use for the forum. ]]

Function Signature
--[[
	specify channel forum tags that are available to the channel.

	This is the list of tags that the channel will use for the forum.
]]
function Channel.Prototype.setForumTags(self: Channel, forumTags: {apiTypes.ForumTagObject}) -> Channel end

Arguments

forumTags

{apiTypes.ForumTagObject}

Returns

ret1

Channel

Channel.Prototype.setDefaultSortOrder

[[ sets the default sort order for the channel.

This is the sort order that the channel will use for newly created threads. ]]

Function Signature
--[[
	sets the default sort order for the channel.

	This is the sort order that the channel will use for newly created threads.
]]
function Channel.Prototype.setDefaultSortOrder(self: Channel, sortOrder: channelTypes.ForumSortOrder) -> Channel end

Arguments

sortOrder

channelTypes.ForumSortOrder

Returns

ret1

Channel

Channel.Prototype.setDefaultForumLayout

[[ sets the default forum layout for the channel.

This is the layout that the channel will use for newly created threads. ]]

Function Signature
--[[
	sets the default forum layout for the channel.

	This is the layout that the channel will use for newly created threads.
]]
function Channel.Prototype.setDefaultForumLayout(self: Channel, forumLayout: channelTypes.ForumLayout) -> Channel end

Arguments

forumLayout

channelTypes.ForumLayout

Returns

ret1

Channel

Channel.Prototype.setDefaultThreadRateLimitPerUser

[[ sets the default thread rate limit per user for the channel.

This is the amount of seconds a user has to wait before sending another message in the thread, ]]

Function Signature
--[[
	sets the default thread rate limit per user for the channel.

	This is the amount of seconds a user has to wait before sending another message in the thread,
]]
function Channel.Prototype.setDefaultThreadRateLimitPerUser(self: Channel, threadRateLimitPerUser: number) -> Channel end

Arguments

threadRateLimitPerUser

number

Returns

ret1

Channel

Channel.Prototype.setFlags

[[ Sets the channel flags using a bitfield value.

The flags control various channel settings and behaviors. ]]

Function Signature
--[[
	Sets the channel flags using a bitfield value.

	The flags control various channel settings and behaviors.
]]
function Channel.Prototype.setFlags(self: Channel, bitflags: number) -> Channel end

Arguments

bitflags

number

Returns

ret1

Channel

Channel.Prototype.setIcon

[[ Sets the channel icon using the provided icon data.

The icon data should be a base64 encoded image string. ]]

Function Signature
--[[
	Sets the channel icon using the provided icon data.

	The icon data should be a base64 encoded image string.
]]
function Channel.Prototype.setIcon(self: Channel, iconData: string) -> Channel end

Arguments

iconData

string

Returns

ret1

Channel

Channel.Prototype.build

[[ Responsible for buillding the channel object that the Discord API can understand. ]]

Function Signature
--[[
	Responsible for buillding the channel object that the Discord API can understand.
]]
function Channel.Prototype.build(self: Channel) -> JSON end

Returns

ret1

JSON

Channel.Interface.new

[[ Constructor for the Discord Channel Builder. ]]

Function Signature
--[[
	Constructor for the Discord Channel Builder.
]]
function Channel.Interface.new(resource: {
		channelName: string?,

		channelType: channelTypes.ChannelType?,

		channelPosition: number?,

		channelPermissionOverwrites: {apiTypes.OverwriteObject}?
	}?) -> Channel end

Arguments

resource

This field is optional and may not be specified

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

Returns

ret1

Channel

Last updated on