Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ThreadChannel): Allow editing flags #8671

Merged
merged 2 commits into from Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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