mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
feat(BaseChannel): Add isThreadOnly() (#9847)
* add isThreadBased * Update typings * fix name --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -147,6 +147,14 @@ class BaseChannel extends Base {
|
|||||||
return 'bitrate' in this;
|
return 'bitrate' in this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether this channel is {@link ThreadOnlyChannel thread-only}.
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isThreadOnly() {
|
||||||
|
return 'availableTags' in this;
|
||||||
|
}
|
||||||
|
|
||||||
toJSON(...props) {
|
toJSON(...props) {
|
||||||
return super.toJSON({ createdTimestamp: true }, ...props);
|
return super.toJSON({ createdTimestamp: true }, ...props);
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -942,6 +942,7 @@ export abstract class BaseChannel extends Base {
|
|||||||
public isTextBased(): this is TextBasedChannel;
|
public isTextBased(): this is TextBasedChannel;
|
||||||
public isDMBased(): this is PartialGroupDMChannel | DMChannel | PartialDMChannel;
|
public isDMBased(): this is PartialGroupDMChannel | DMChannel | PartialDMChannel;
|
||||||
public isVoiceBased(): this is VoiceBasedChannel;
|
public isVoiceBased(): this is VoiceBasedChannel;
|
||||||
|
public isThreadOnly(): this is ThreadOnlyChannel;
|
||||||
public toString(): ChannelMention | UserMention;
|
public toString(): ChannelMention | UserMention;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user