Abstract

ThreadOnlyChannel

export abstract class ThreadOnlyChannel extends TextBasedChannelMixin(GuildChannel, true, [ 'send', 'lastMessage', 'lastPinAt', 'bulkDelete', 'sendTyping', 'createMessageCollector', 'awaitMessages', 'createMessageComponentCollector', 'awaitMessageComponent',])
export abstract class ThreadOnlyChannel extends TextBasedChannelMixin(GuildChannel, true, [ 'send', 'lastMessage', 'lastPinAt', 'bulkDelete', 'sendTyping', 'createMessageCollector', 'awaitMessages', 'createMessageComponentCollector', 'awaitMessageComponent',])
Represents symbols utilised by thread-only channels.

Extends

TextBasedChannelMixin(GuildChannel, true, [ 'send', 'lastMessage', 'lastPinAt', 'bulkDelete', 'sendTyping', 'createMessageCollector', 'awaitMessages', 'createMessageComponentCollector', 'awaitMessageComponent',])
availableTags:GuildForumTag[]
The set of tags that can be used in this channel.
Readonly
client:Client
The client that instantiated this
Readonly
createdAt:Date
The time the channel was created at
Readonly
createdTimestamp:number
The timestamp the channel was created at
defaultAutoArchiveDuration:ThreadAutoArchiveDuration | null
The default auto archive duration for newly created threads in this channel.
defaultReactionEmoji:DefaultReactionEmoji | null
The emoji to show in the add reaction button on a thread in a guild forum channel
defaultSortOrder:SortOrderType | null
The default sort order mode used to order posts
defaultThreadRateLimitPerUser:number | null
The initial rate limit per user (slowmode) to set on newly created threads in a channel.
Readonly
deletable:boolean
Whether the channel is deletable by the client user
The flags that are applied to the channel. This is only null in a PartialGroupDMChannel. In all other cases, it is not null.
guild:Guild
The guild the channel is in
guildId:Snowflake
The id of the guild the channel is in
The channel's id
Readonly
manageable:boolean
Whether the channel is manageable by the client user
Readonly
A collection of cached members of this channel, mapped by their ids. Members that can view this channel, if the channel is text-based. Members in the channel, if the channel is voice-based.
name:string
The name of the guild channel
nsfw:boolean
If this channel is considered NSFW.
Readonly
The category parent of this channel
parentId?:Snowflake
The id of the category parent of this channel
Readonly
partial:boolean
Whether this Channel is a partial This is always false outside of DM channels.
permissionOverwrites:PermissionOverwriteManager
A manager of permission overwrites that belong to this channel
Readonly
permissionsLocked?:boolean
If the permissionOverwrites match the parent channel, null if no parent
Readonly
position:number
The position of the channel
rateLimitPerUser:number | null
The rate limit per user (slowmode) for this channel.
rawPosition:number
The raw position of the channel from Discord
A manager of the threads belonging to this channel
topic:string | null
The topic of this channel.
The type of the channel
Readonly
url:string
The URL to the channel
Readonly
viewable:boolean
Whether the channel is viewable by the client user
createInvite(options?):Promise<Invite>
Creates an invite to this guild channel.
Example
// Create an invite to a channel
channel.createInvite()
.then(invite => console.log(`Created an invite with a code of ${invite.code}`))
.catch(console.error);
// Create an invite to a channel
channel.createInvite()
.then(invite => console.log(`Created an invite with a code of ${invite.code}`))
.catch(console.error);
NameTypeOptionalDescription
optionsInviteCreateOptionsYesThe options for creating the invite
createWebhook(options?):Promise<Webhook>
Creates a webhook for the channel.
Returns
Returns the created Webhook *
Example
// Create a webhook for the current channel
channel.createWebhook({
name: 'Snek',
avatar: 'https://i.imgur.com/mI8XcpG.jpg',
reason: 'Needed a cool new Webhook'
})
.then(console.log)
.catch(console.error)
// Create a webhook for the current channel
channel.createWebhook({
name: 'Snek',
avatar: 'https://i.imgur.com/mI8XcpG.jpg',
reason: 'Needed a cool new Webhook'
})
.then(console.log)
.catch(console.error)
NameTypeOptionalDescription
optionsChannelWebhookCreateOptionsYesOptions for creating the webhook
fetchInvites(cache?):Promise<Collection<string, Invite>>
Fetches a collection of invites to this guild channel. Resolves with a collection mapping invites by their codes.
NameTypeOptionalDescription
cachebooleanYesWhether to cache the fetched invites
fetchWebhooks():Promise<Collection<Snowflake, Webhook>>
Fetches all webhooks for the channel.
Example
// Fetch webhooks
channel.fetchWebhooks()
.then(hooks => console.log(`This channel has ${hooks.size} hooks`))
.catch(console.error);
// Fetch webhooks
channel.fetchWebhooks()
.then(hooks => console.log(`This channel has ${hooks.size} hooks`))
.catch(console.error);
setAvailableTags(availableTags, reason?):Promise<this>
Sets the available tags for this forum channel
NameTypeOptionalDescription
availableTagsGuildForumTagData[]NoThe tags to set as available in this channel
reasonstringYesReason for changing the available tags
setDefaultAutoArchiveDuration(defaultAutoArchiveDuration, reason?):Promise<this>
Sets the default auto archive duration for all newly created threads in this channel.
NameTypeOptionalDescription
defaultAutoArchiveDurationThreadAutoArchiveDurationNoThe new default auto archive duration
reasonstringYesReason for changing the channel's default auto archive duration
setDefaultReactionEmoji(defaultReactionEmoji, reason?):Promise<this>
Sets the default reaction emoji for this channel
NameTypeOptionalDescription
defaultReactionEmojiDefaultReactionEmoji | nullNoThe emoji to set as the default reaction emoji
reasonstringYesReason for changing the default reaction emoji
setDefaultSortOrder(defaultSortOrder, reason?):Promise<this>
Sets the default sort order mode used to order posts
NameTypeOptionalDescription
defaultSortOrderSortOrderType | nullNoThe default sort order mode to set on this channel
reasonstringYesReason for changing the default sort order
setDefaultThreadRateLimitPerUser(defaultThreadRateLimitPerUser, reason?):Promise<this>
Sets the default rate limit per user (slowmode) for new threads in this channel
NameTypeOptionalDescription
defaultThreadRateLimitPerUsernumberNoThe rate limit to set on newly created threads in this channel
reasonstringYesReason for changing the default rate limit
setNSFW(nsfw?, reason?):Promise<this>
Sets whether this channel is flagged as NSFW.
NameTypeOptionalDescription
nsfwbooleanYesWhether the channel should be considered NSFW
reasonstringYesReason for changing the channel's NSFW flag
setRateLimitPerUser(rateLimitPerUser, reason?):Promise<this>
Sets the rate limit per user (slowmode) for this channel.
NameTypeOptionalDescription
rateLimitPerUsernumberNoThe new rate limit in seconds
reasonstringYesReason for changing the channel's rate limit
setTopic(topic, reason?):Promise<this>
Sets a new topic for the guild channel.
Example
// Set a new channel topic
channel.setTopic('needs more rate limiting')
.then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))
.catch(console.error);
// Set a new channel topic
channel.setTopic('needs more rate limiting')
.then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))
.catch(console.error);
NameTypeOptionalDescription
topicstring | nullNoThe new topic for the guild channel
reasonstringYesReason for changing the guild channel's topic