Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(BaseChannel): Add isThreadOnly() (#9847)
* add isThreadBased

* Update typings

* fix name

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
RedGuy12 and kodiakhq[bot] committed Oct 10, 2023
1 parent 11f6955 commit 699b232
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/discord.js/src/structures/BaseChannel.js
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/typings/index.d.ts
Expand Up @@ -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;
}

Expand Down

0 comments on commit 699b232

Please sign in to comment.