Skip to content

Commit

Permalink
fix(ThreadChannel): Allow editing flags (#8671)
Browse files Browse the repository at this point in the history
fix(ThreadChannel): allow editing flags

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
Jiralite and kodiakhq[bot] committed Sep 24, 2022
1 parent b1e190c commit 1244854
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/discord.js/src/structures/ThreadChannel.js
Expand Up @@ -6,6 +6,7 @@ const TextBasedChannel = require('./interfaces/TextBasedChannel');
const { RangeError, ErrorCodes } = require('../errors');
const MessageManager = require('../managers/MessageManager');
const ThreadMemberManager = require('../managers/ThreadMemberManager');
const ChannelFlagsBitField = require('../util/ChannelFlagsBitField');

/**
* Represents a thread channel on Discord.
Expand Down Expand Up @@ -324,6 +325,7 @@ class ThreadChannel extends BaseChannel {
* @property {boolean} [locked] Whether the thread is locked
* @property {boolean} [invitable] Whether non-moderators can add other non-moderators to a thread
* @property {Snowflake[]} [appliedTags] The tags to apply to the thread
* @property {ChannelFlagsResolvable} [flags] The flags to set on the channel
* @property {string} [reason] Reason for editing the thread
* <info>Can only be edited on {@link ChannelType.PrivateThread}</info>
*/
Expand All @@ -348,6 +350,7 @@ class ThreadChannel extends BaseChannel {
locked: data.locked,
invitable: this.type === ChannelType.PrivateThread ? data.invitable : undefined,
applied_tags: data.appliedTags,
flags: 'flags' in data ? ChannelFlagsBitField.resolve(data.flags) : undefined,
},
reason: data.reason,
});
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/typings/index.d.ts
Expand Up @@ -5658,6 +5658,7 @@ export interface ThreadEditData {
locked?: boolean;
invitable?: boolean;
appliedTags?: Snowflake[];
flags?: ChannelFlagsResolvable;
reason?: string;
}

Expand Down

0 comments on commit 1244854

Please sign in to comment.