diff --git a/packages/discord.js/src/structures/BaseChannel.js b/packages/discord.js/src/structures/BaseChannel.js index 346f7630de24..473a5133e609 100644 --- a/packages/discord.js/src/structures/BaseChannel.js +++ b/packages/discord.js/src/structures/BaseChannel.js @@ -147,6 +147,14 @@ class BaseChannel extends Base { return 'bitrate' in this; } + /** + * Indicates whether this channel is {@link ThreadOnlyChannel thread-only}. + * @returns {boolean} + */ + isThreadOnly() { + return 'availableTags' in this; + } + toJSON(...props) { return super.toJSON({ createdTimestamp: true }, ...props); } diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 04a60dfb73f2..818d62afe0a8 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -942,6 +942,7 @@ export abstract class BaseChannel extends Base { public isTextBased(): this is TextBasedChannel; public isDMBased(): this is PartialGroupDMChannel | DMChannel | PartialDMChannel; public isVoiceBased(): this is VoiceBasedChannel; + public isThreadOnly(): this is ThreadOnlyChannel; public toString(): ChannelMention | UserMention; }