Add basic thread helper functions

This commit is contained in:
Rory&
2026-01-28 22:28:53 +01:00
parent a3ef2482ec
commit af12073fcc

View File

@@ -424,6 +424,18 @@ export class Channel extends BaseClass {
return this.type === ChannelType.DM || this.type === ChannelType.GROUP_DM;
}
isThread() {
return this.type === ChannelType.GUILD_NEWS_THREAD || this.type === ChannelType.GUILD_PUBLIC_THREAD || this.type === ChannelType.GUILD_PRIVATE_THREAD;
}
isPrivateThread() {
return this.type === ChannelType.GUILD_PRIVATE_THREAD;
}
isPublicThread() {
return this.type === ChannelType.GUILD_NEWS_THREAD || this.type === ChannelType.GUILD_PUBLIC_THREAD;
}
// Does the channel support sending messages ( eg categories do not )
isWritable() {
const disallowedChannelTypes = [ChannelType.GUILD_CATEGORY, ChannelType.GUILD_STAGE_VOICE];