Channel
channelOn this page
Channel is the base type for Discord channels. Typed subclasses add send, voice, thread, and forum behavior. Delete a channel with :delete.
Properties
- Name
appliedTags- Type
any- Access
- readonly
- Description
- Instance field
Channel.appliedTags. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
archiveTimestamp- Type
any- Access
- readonly
- Description
- Instance field
Channel.archiveTimestamp. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
archived- Type
any- Access
- readonly
- Description
- Instance field
Channel.archived. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
autoArchiveDuration- Type
any- Access
- readonly
- Description
- Instance field
Channel.autoArchiveDuration. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
availableTags- Type
- Collection
- Access
- readonly
- Description
- Instance field
Channel.availableTags. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Related
- Collection
- Name
bitrate- Type
any- Access
- readonly
- Description
- Instance field
Channel.bitrate. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
children- Type
- CategoryChannelChildManager
- Access
- readonly
- Description
- Cache and REST facade for categorychannelchild objects owned by this Channel. Use it to fetch, create, resolve, and mutate those resources.
- Availability
- Created in
Channel.newand remains valid for the lifetime of the Channel. - Related
- CategoryChannelChildManager
- Name
client- Type
any- Access
- readonly
- Description
- Owning Client instance used for REST, cache, and event dispatch.
- Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
defaultAutoArchiveDuration- Type
any- Access
- mutable
- Description
- Instance field
Channel.defaultAutoArchiveDuration. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
defaultForumLayout- Type
any- Access
- readonly
- Description
- Instance field
Channel.defaultForumLayout. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
defaultReactionEmoji- Type
any- Access
- readonly
- Description
- Instance field
Channel.defaultReactionEmoji. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
defaultSortOrder- Type
any- Access
- readonly
- Description
- Instance field
Channel.defaultSortOrder. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
defaultThreadRateLimitPerUser- Type
any- Access
- readonly
- Description
- Instance field
Channel.defaultThreadRateLimitPerUser. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
flags- Type
any- Access
- readonly
- Description
- Instance field
Channel.flags. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
guildId- Type
any- Access
- readonly
- Description
- Instance field
Channel.guildId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
icon- Type
any- Access
- readonly
- Description
- Instance field
Channel.icon. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this Channel.
- Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
invitable- Type
any- Access
- readonly
- Description
- Instance field
Channel.invitable. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
invites- Type
- GuildInviteManager
- Access
- readonly
- Description
- Cache and REST facade for guildinvite objects owned by this Channel. Use it to fetch, create, resolve, and mutate those resources.
- Availability
- Created in
Channel.newand remains valid for the lifetime of the Channel. - Related
- GuildInviteManager
- Name
lastMessageId- Type
any- Access
- readonly
- Description
- Instance field
Channel.lastMessageId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
lastPinTimestamp- Type
any- Access
- readonly
- Description
- Instance field
Channel.lastPinTimestamp. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
locked- Type
any- Access
- readonly
- Description
- Instance field
Channel.locked. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
memberCount- Type
any- Access
- readonly
- Description
- Instance field
Channel.memberCount. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
members- Type
threadMembers- Access
- readonly
- Description
- Instance field
Channel.members. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
messageCount- Type
any- Access
- readonly
- Description
- Instance field
Channel.messageCount. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
messages- Type
messageManager- Access
- readonly
- Description
- Cache and REST facade for message objects owned by this Channel. Use it to fetch, create, resolve, and mutate those resources.
- Availability
- Created in
Channel.newand remains valid for the lifetime of the Channel.
- Name
name- Type
any- Access
- mutable
- Description
- Display name of this Channel.
- Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
nsfw- Type
any- Access
- readonly
- Description
- Instance field
Channel.nsfw. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
ownerId- Type
any- Access
- readonly
- Description
- Instance field
Channel.ownerId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
parentId- Type
any- Access
- readonly
- Description
- Instance field
Channel.parentId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
permissionOverwrites- Type
overwriteManager- Access
- readonly
- Description
- Cache and REST facade for overwrite objects owned by this Channel. Use it to fetch, create, resolve, and mutate those resources.
- Availability
- Created in
Channel.newand remains valid for the lifetime of the Channel.
- Name
position- Type
any- Access
- mutable
- Description
- Instance field
Channel.position. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
rateLimitPerUser- Type
any- Access
- mutable
- Description
- Instance field
Channel.rateLimitPerUser. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
Channel.raw. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
recipient- Type
UserMod- Access
- readonly
- Description
- Instance field
Channel.recipient. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
recipientId- Type
any- Access
- readonly
- Description
- Instance field
Channel.recipientId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
recipientIds- Type
any- Access
- readonly
- Description
- Instance field
Channel.recipientIds. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
recipients- Type
any- Access
- readonly
- Description
- Instance field
Channel.recipients. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
rtcRegion- Type
any- Access
- readonly
- Description
- Instance field
Channel.rtcRegion. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
threads- Type
- GuildTextThreadManager
- Access
- readonly
- Description
- Cache and REST facade for guildtextthread objects owned by this Channel. Use it to fetch, create, resolve, and mutate those resources.
- Availability
- Created in
Channel.newand remains valid for the lifetime of the Channel. - Related
- GuildTextThreadManager
- Name
topic- Type
any- Access
- mutable
- Description
- Instance field
Channel.topic. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
totalMessageSent- Type
any- Access
- readonly
- Description
- Instance field
Channel.totalMessageSent. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
type- Type
any- Access
- mutable
- Description
- Instance field
Channel.type. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
userLimit- Type
any- Access
- readonly
- Description
- Instance field
Channel.userLimit. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
- Name
videoQualityMode- Type
any- Access
- readonly
- Description
- Instance field
Channel.videoQualityMode. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Channel.
Methods
Channel:addFollower()
#Add Follower to this Channel.
Signature
Channel:addFollower(targetChannel, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
targetChannel |
any |
required | Passed through to the implementation as written. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:addFollower(targetChannel, function(err, result)
if err then error(err) end
end)Channel:awaitMessageComponent()
#Performs await message component on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:awaitMessageComponent(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
any.
Example
local discord = require("discord")
-- object is a Channel
object:awaitMessageComponent({}, function(err, result)
if err then error(err) end
end)Channel:awaitMessages()
#Performs await messages on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:awaitMessages(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
any.
Example
local discord = require("discord")
-- object is a Channel
object:awaitMessages({}, function(err, result)
if err then error(err) end
end)Channel:bulkDelete()
#Delete many messages in this channel through REST.
Signature
Channel:bulkDelete(messages, filterOld, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
messages |
any |
required | Passed through to the implementation as written. |
filterOld |
any |
required | Passed through to the implementation as written. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
any.
Example
local discord = require("discord")
-- object is a Channel
object:bulkDelete(messages, filterOld, function(err, result)
if err then error(err) end
end)Channel:clone()
#Performs clone on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:clone(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:clone({}, function(err, result)
if err then error(err) end
end)Channel:createdAt()
#Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Channel:createdAt() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:createdAt()Channel:createdTimestamp()
#Create dTimestamp through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Channel:createdTimestamp() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:createdTimestamp()Channel:createInteractionCollector()
#Create InteractionCollector through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Channel:createInteractionCollector(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:createInteractionCollector({})Channel:createInvite()
#Create Invite through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Channel:createInvite(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:createInvite({}, function(err, result)
if err then error(err) end
end)Channel:createMessageCollector()
#Create MessageCollector through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Channel:createMessageCollector(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:createMessageCollector({})Channel:createMessageComponentCollector()
#Create MessageComponentCollector through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Channel:createMessageComponentCollector(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:createMessageComponentCollector({})Channel:createWebhook()
#Create Webhook through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
Channel:createWebhook(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:createWebhook({}, function(err, result)
if err then error(err) end
end)Channel:deletable()
#Performs deletable on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:deletable() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:deletable()Channel:delete()
#Permanently delete this resource through REST.
Signature
Channel:delete(reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
reason |
string |
optional | Audit-log reason sent as X-Audit-Log-Reason on REST mutations. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:delete(reason, function(err, result)
if err then error(err) end
end)Channel:edit()
#Apply a REST update to this resource.
Signature
Channel:edit(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:edit({}, function(err, result)
if err then error(err) end
end)Channel:equals()
#Return whether this Channel refers to the same resource as the argument.
Signature
Channel:equals(other) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
other |
any |
required | Passed through to the implementation as written. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:equals(other)Channel:fetch()
#Request a fresh copy of this resource from REST and update the cache.
Signature
Channel:fetch(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:fetch(function(err, result)
if err then error(err) end
end)Channel:fetchInvites()
#Fetch Invites from REST and update the local cache when the request succeeds.
Signature
Channel:fetchInvites(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:fetchInvites(function(err, result)
if err then error(err) end
end)Channel:fetchMessages()
#Fetch Messages from REST and update the local cache when the request succeeds.
Signature
Channel:fetchMessages(limitOrOptions, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
limitOrOptions |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:fetchMessages({}, function(err, result)
if err then error(err) end
end)Channel:fetchWebhooks()
#Fetch Webhooks from REST and update the local cache when the request succeeds.
Signature
Channel:fetchWebhooks(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:fetchWebhooks(function(err, result)
if err then error(err) end
end)Channel:guild()
#Performs guild on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:guild() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:guild()Channel:iconURL()
#Performs icon url on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:iconURL(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:iconURL({})Channel:isDMBased()
#Predicate that returns whether this Channel matches isDMBased. Use it to branch before calling type-specific methods.
Signature
Channel:isDMBased() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:isDMBased()Channel:isSendable()
#Predicate that returns whether this Channel matches isSendable. Use it to branch before calling type-specific methods.
Signature
Channel:isSendable() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:isSendable()Channel:isTextBased()
#Predicate that returns whether this Channel matches isTextBased. Use it to branch before calling type-specific methods.
Signature
Channel:isTextBased() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:isTextBased()Channel:isThread()
#Predicate that returns whether this Channel matches isThread. Use it to branch before calling type-specific methods.
Signature
Channel:isThread() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:isThread()Channel:isThreadOnly()
#Predicate that returns whether this Channel matches isThreadOnly. Use it to branch before calling type-specific methods.
Signature
Channel:isThreadOnly() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:isThreadOnly()Channel:isVoiceBased()
#Predicate that returns whether this Channel matches isVoiceBased. Use it to branch before calling type-specific methods.
Signature
Channel:isVoiceBased() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:isVoiceBased()Channel:lastMessage()
#Performs last message on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:lastMessage() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:lastMessage()Channel:lastPinAt()
#Performs last pin at on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:lastPinAt() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:lastPinAt()Channel:lockPermissions()
#Copy the parent category permission overwrites onto this channel.
Signature
Channel:lockPermissions(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Throws
A DiscordLua error when arguments are invalid or the request fails without a callback.
Example
local discord = require("discord")
-- object is a Channel
object:lockPermissions(function(err, result)
if err then error(err) end
end)Channel:manageable()
#Performs manageable on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:manageable() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:manageable()Channel:parent()
#Performs parent on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:parent() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:parent()Channel:partial()
#Performs partial on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:partial() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:partial()Channel:permissionsFor()
#Performs permissions for on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:permissionsFor(memberOrRole, checkAdmin) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
memberOrRole |
any |
required | Passed through to the implementation as written. |
checkAdmin |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a Channel
object:permissionsFor(memberOrRole, checkAdmin)Channel:permissionsLocked()
#Performs permissions locked on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:permissionsLocked() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:permissionsLocked()Channel:rawPosition()
#Performs raw position on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:rawPosition() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:rawPosition()Channel:send()
#Send a message, payload, or packet using this object.
Signature
Channel:send(contentOrOptions, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
contentOrOptions |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:send("Hello", function(err, result)
if err then error(err) end
end)Channel:sendTyping()
#Send Typing using this Channel.
Signature
Channel:sendTyping() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:sendTyping()Channel:setDefaultAutoArchiveDuration()
#Set the DefaultAutoArchiveDuration field. Builders return this Channel so setters can be chained.
Signature
Channel:setDefaultAutoArchiveDuration(duration) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
duration |
any |
required | Passed through to the implementation as written. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:setDefaultAutoArchiveDuration(duration)Channel:setName()
#Set the Name field. Builders return this Channel so setters can be chained.
Signature
Channel:setName(name) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:setName(name)Channel:setNSFW()
#Set the NSFW field. Builders return this Channel so setters can be chained.
Signature
Channel:setNSFW(nsfw) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
nsfw |
any |
required | Passed through to the implementation as written. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:setNSFW(nsfw)Channel:setParent()
#Set the Parent field. Builders return this Channel so setters can be chained.
Signature
Channel:setParent(parentId) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
parentId |
string |
required | Snowflake id string. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:setParent("123")Channel:setPosition()
#Set the Position field. Builders return this Channel so setters can be chained.
Signature
Channel:setPosition(position) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
position |
any |
required | Passed through to the implementation as written. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:setPosition(position)Channel:setRateLimitPerUser()
#Set the RateLimitPerUser field. Builders return this Channel so setters can be chained.
Signature
Channel:setRateLimitPerUser(seconds, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
seconds |
any |
required | Passed through to the implementation as written. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:setRateLimitPerUser(seconds, function(err, result)
if err then error(err) end
end)Channel:setSlowmode()
#Set the Slowmode field. Builders return this Channel so setters can be chained.
Signature
Channel:setSlowmode(seconds, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
seconds |
any |
required | Passed through to the implementation as written. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:setSlowmode(seconds, function(err, result)
if err then error(err) end
end)Channel:setTopic()
#Set the Topic field. Builders return this Channel so setters can be chained.
Signature
Channel:setTopic(topic) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
topic |
any |
required | Passed through to the implementation as written. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:setTopic(topic)Channel:setType()
#Set the Type field. Builders return this Channel so setters can be chained.
Signature
Channel:setType(channelType) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
channelType |
any |
required | Passed through to the implementation as written. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:setType(channelType)Channel:startTyping()
#Performs start typing on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:startTyping(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:startTyping(function(err, result)
if err then error(err) end
end)Channel:toJSON()
#Serialize this Channel into a Lua table suitable for REST or debugging.
Signature
Channel:toJSON() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:toJSON()Channel:toString()
#function toString() { [native code] }
Signature
Channel:toString() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:toString()Channel:url()
#Performs url on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:url() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:url()Channel:viewable()
#Performs viewable on this Channel. Call it from bot code when you need that operation on the current object.
Signature
Channel:viewable() Parameters
No parameters.
Returns
Channel — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Channel
object:viewable()Static members
-
Channel.AnnouncementChannel -
Channel.BaseGuildTextChannel -
Channel.BaseGuildVoiceChannel -
Channel.CategoryChannel -
Channel.DMChannel -
Channel.DirectoryChannel -
Channel.ForumChannel -
Channel.GuildChannel -
Channel.MediaChannel -
Channel.NewsChannel -
Channel.PartialGroupDMChannel -
Channel.StageChannel -
Channel.TextChannel -
Channel.ThreadChannel -
Channel.ThreadOnlyChannel -
Channel.VoiceChannel
Examples
Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.
Related APIs
BaseGuildTextChannel · BaseGuildVoiceChannel · CategoryChannel · DirectoryChannel · DMChannel · ForumChannel · GuildChannel · MediaChannel
Version: discord 1.2.4 · runtime 1.0.0