ForumChannel

ForumChannel

Represents a guild forum channel. See MediaChannel for more properties and methods

Constructor

new ForumChannel()

Properties:
Name Type Description
defaultForumLayout Number

The default forum layout type used to display posts in the channel

Source:

Extends

Methods

createInvite(optionsopt, reasonopt) → {Promise.<Invite>}

Create an invite for the channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
options Object <optional>

Invite generation options

Name Type Attributes Description
maxAge Number <optional>

How long the invite should last in seconds

maxUses Number <optional>

How many uses the invite should last for

temporary Boolean <optional>

Whether the invite grants temporary membership or not

unique Boolean <optional>

Whether the invite is unique or not

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Invite>

createThread(options, fileopt) → {Promise.<ThreadChannel>}

Create a thread inside the channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
options Object

The thread options

Name Type Attributes Description
appliedTags Array.<String> <optional>

The IDs of the set of tags that have been applied to a thread in a forum/media channel (threads created in forum/media channels only, max 5)

autoArchiveDuration Number <optional>

The duration in minutes to automatically archive the thread after recent activity, either 60, 1440, 4320 or 10080 (thread channels only)

message Object <optional>

The message to create with the thread. Note: When creating a forum/media channel thread, you must provide at least one of content, embeds, stickerIDs, components, or files

Name Type Attributes Description
allowedMentions Object <optional>

A list of mentions to allow (overrides default)

Name Type Attributes Description
everyone Boolean <optional>

Whether or not to allow @everyone/@here

repliedUser Boolean <optional>

Whether or not to mention the author of the message being replied to

roles Boolean | Array.<String> <optional>

Whether or not to allow all role mentions, or an array of specific role mentions to allow

users Boolean | Array.<String> <optional>

Whether or not to allow all user mentions, or an array of specific user mentions to allow

attachments Array.<Object> <optional>

An array of attachment objects with the filename and description

Name Type Attributes Description
description String <optional>

The description of the file

filename String <optional>

The name of the file

id Number

The index of the file

components Array.<Object> <optional>

An array of component objects

Name Type Attributes Description
custom_id String <optional>

The ID of the component (type 2 style 0-4 and type 3,5,6,7,8 only)

disabled Boolean <optional>

Whether the component is disabled (type 2 and 3,5,6,7,8 only)

emoji Object <optional>

The emoji to be displayed in the component (type 2)

label String <optional>

The label to be displayed in the component (type 2)

default_values Array.<Object> <optional>

default values for the component (type 5,6,7,8 only)

Name Type Attributes Description
id String <optional>

id of a user, role, or channel

type String <optional>

type of value that id represents (user, role, or channel)

max_values Number <optional>

The maximum number of items that can be chosen (1-25, default 1)

min_values Number <optional>

The minimum number of items that must be chosen (0-25, default 1)

options Array.<Object> <optional>

The options for this component (type 3 only)

Name Type Attributes Description
default Boolean <optional>

Whether this option should be the default value selected

description String <optional>

The description for this option

emoji Object <optional>

The emoji to be displayed in this option

label String

The label for this option

value Number | String

The value for this option

placeholder String <optional>

The placeholder text for the component when no option is selected (type 3,5,6,7,8 only)

style Number <optional>

The style of the component (type 2 only) - If 0-4, custom_id is required; if 5, url is required

type Number

The type of component - If 1, it is a collection and a components array (nested) is required; if 2, it is a button; if 3, it is a string select; if 5, it is a user select; if 6, it is a role select; if 7, it is a mentionable select; if 8, it is a channel select

url String <optional>

The URL that the component should open for users (type 2 style 5 only)

content String <optional>

A string containing the message content

embeds Array.<Object> <optional>

An array of embed objects. See the official Discord API documentation entry for object structure

stickerIDs Array.<String> <optional>

An array of IDs corresponding to stickers to send

name String

The thread channel name

rateLimitPerUser Number <optional>

The time in seconds a user has to wait before sending another message (0-21600) (does not affect bots or users with manageMessages/manageChannel permissions)

reason String <optional>

The reason to be displayed in audit logs

file Object | Array.<Object> <optional>

A file object (or an Array of them)

Name Type Description
file Buffer

A buffer containing file data

name String

What to name the file

Returns:
Type:
Promise.<ThreadChannel>

createWebhook(options, reasonopt) → {Promise.<Object>}

Create a channel webhook

Overrides:
Source:
Parameters:
Name Type Attributes Description
options Object

Webhook options

Name Type Attributes Description
avatar String <optional>

The default avatar as a base64 data URI. Note: base64 strings alone are not base64 data URI strings

name String

The default name

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<Object>

Resolves with a webhook object

delete(reasonopt) → {Promise.<(CategoryChannel|ForumChannel|NewsChannel|NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel|TextChannel|VoiceChannel)>}

Delete the channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
reason String <optional>

The reason to be displayed in audit logs

deletePermission(overwriteID, reasonopt) → {Promise}

Delete a channel permission overwrite

Overrides:
Source:
Parameters:
Name Type Attributes Description
overwriteID String

The ID of the overwritten user or role

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise

edit(options, reasonopt) → {Promise.<(CategoryChannel|ForumChannel|NewsChannel|NewsThreadChannel|PrivateThreadChannel|PublicThreadChannel|TextChannel|VoiceChannel)>}

Edit the channel's properties

Overrides:
Source:
Parameters:
Name Type Attributes Description
options Object

The properties to edit

Name Type Attributes Description
appliedTags Array.<String> <optional>

[Th] The tags applied to a forum/media thread

archived Boolean <optional>

[Th] The archive status of the channel

autoArchiveDuration Number <optional>

[Th] The duration in minutes to automatically archive the thread after recent activity, either 60, 1440, 4320 or 10080

availableTags Array.<Object> <optional>

[FM] An array of tags that can be applied. This will overwrite all existing tags unless edited by specifying the tag ID

bitrate Number <optional>
<nullable>

[VS] The bitrate of the channel

defaultAutoArchiveDuration Number <optional>
<nullable>

[TAFM] The default duration of newly created threads in minutes to automatically archive the thread after inactivity (60, 1440, 4320, 10080)

defaultForumLayout Number <optional>

[F] The default post layout type

defaultReactionEmoji Object <optional>
<nullable>

[FM] The emoji to show in the Add Reaction Button

defaultSortOrder Number <optional>
<nullable>

[FM] The default post sort type (0 for latest activity, 1 for creation date)

defaultThreadRateLimitPerUser Number <optional>

[TFM] The default rate limit duration for newly created threads

flags Number <optional>

[FM/Th] The channel's flag bit set

invitable Boolean <optional>

[Th] Whether non-moderators can add other non-moderators to the channel

locked Boolean <optional>

[Th] The lock status of the channel

name String <optional>

[All/Th] The name of the channel

nsfw Boolean <optional>
<nullable>

[TVASFM] The NSFW status of the channel

parentID String <optional>
<nullable>

[TVASFM] The ID of the parent channel category for this channel

permissionOverwrites Array.<Object> <optional>
<nullable>

[All] An object containing permission overwrite objects

position Number <optional>
<nullable>

[All] The sorting position of the channel

rateLimitPerUser Number <optional>
<nullable>

[TVSFM/Th] The time in seconds a user has to wait before sending another message (does not affect bots or users with manageMessages/manageChannel permissions)

rtcRegion String <optional>
<nullable>

[VS] The RTC region ID of the channel (automatic if null)

topic String <optional>
<nullable>

[TAFM] The topic of the channel

type Boolean <optional>

[TA] The type of channel (only between types 0 and 5)

userLimit Number <optional>
<nullable>

[VS] The channel user limit

videoQualityMode Number <optional>
<nullable>

[VS] The camera video quality mode of the channel. 1 is auto, 2 is 720p

reason String <optional>

The reason to be displayed in audit logs

editPermission(overwriteID, allow, deny, type, reasonopt) → {Promise.<PermissionOverwrite>}

Create a channel permission overwrite

Overrides:
Source:
Parameters:
Name Type Attributes Description
overwriteID String

The ID of the overwritten user or role

allow BigInt | Number | String

The permissions number for allowed permissions

deny BigInt | Number | String

The permissions number for denied permissions

type Number

The object type of the overwrite, either 1 for "member" or 0 for "role"

reason String <optional>

The reason to be displayed in audit logs

Returns:
Type:
Promise.<PermissionOverwrite>

getArchivedThreads(optionsopt) → {Promise.<Object>}

Get all archived threads in the channel

Overrides:
Source:
Parameters:
Name Type Attributes Description
options Object <optional>

Additional options when requesting archived threads

Name Type Attributes Description
before Date <optional>

List of threads to return before the timestamp

limit Number <optional>

Maximum number of threads to return

Returns:
Type:
Promise.<Object>

An object containing an array of threads, an array of members and whether the response hasMore threads that could be returned in a subsequent call

getInvites() → {Promise.<Array.<Invite>>}

Get all invites in the channel

Overrides:
Source:
Returns:
Type:
Promise.<Array.<Invite>>

getWebhooks() → {Promise.<Array.<Object>>}

Get all the webhooks in the channel

Overrides:
Source:
Returns:
Type:
Promise.<Array.<Object>>

Resolves with an array of webhook objects

permissionsOf(memberID) → {Permission}

Get the channel-specific permissions of a member

Overrides:
Source:
Parameters:
Name Type Description
memberID String | Member | Object

The ID of the member or a Member object

Returns:
Type:
Permission