summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-01-28 22:28:53 +0100
committerRory& <root@rory.gay>2026-01-28 22:28:53 +0100
commitaf12073fcc6ef1b50f4ecb64db42a0fa6a6fc361 (patch)
treea6aca987eaba906df16272d1981df71dd73bf6af
parentUpdate channel type enum to un-erkinalp-ize it, and match discord (diff)
downloadserver-ts-af12073fcc6ef1b50f4ecb64db42a0fa6a6fc361.tar.xz
Add basic thread helper functions
-rw-r--r--src/util/entities/Channel.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts

index 65e4a000..e978a9c6 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts
@@ -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];