summary refs log tree commit diff
path: root/util/src/entities/Channel.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-05-31 00:22:18 +1000
committerGitHub <noreply@github.com>2022-05-31 00:22:18 +1000
commit82216f1513a32e9eaa8622f759656e4c5fe52573 (patch)
treece527a07dfdceee20bd31010b0102b693d61b60b /util/src/entities/Channel.ts
parentAdded README, added more UDP decryption stuff (diff)
parentMerge pull request #759 from MaddyUnderStars/fix/respectRegisterConfig (diff)
downloadserver-82216f1513a32e9eaa8622f759656e4c5fe52573.tar.xz
Merge branch 'fosscord:master' into maddyrtc
Diffstat (limited to '')
-rw-r--r--util/src/entities/Channel.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/util/src/entities/Channel.ts b/util/src/entities/Channel.ts

index 4bf81901..69c08be7 100644 --- a/util/src/entities/Channel.ts +++ b/util/src/entities/Channel.ts
@@ -28,6 +28,8 @@ export enum ChannelType { GUILD_PUBLIC_THREAD = 11, // a temporary sub-channel within a GUILD_TEXT channel GUILD_PRIVATE_THREAD = 12, // a temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission GUILD_STAGE_VOICE = 13, // a voice channel for hosting events with an audience + DIRECTORY = 14, // guild directory listing channel + GUILD_FORUM = 15, // forum composed of IM threads TICKET_TRACKER = 33, // ticket tracker, individual ticket items shall have type 12 KANBAN = 34, // confluence like kanban board VOICELESS_WHITEBOARD = 35, // whiteboard but without voice (whiteboard + voice is the same as stage) @@ -352,6 +354,16 @@ export class Channel extends BaseClass { isDm() { return this.type === ChannelType.DM || this.type === ChannelType.GROUP_DM; } + + // Does the channel support sending messages ( eg categories do not ) + isWritable() { + const disallowedChannelTypes = [ + ChannelType.GUILD_CATEGORY, + ChannelType.GUILD_STAGE_VOICE, + ChannelType.VOICELESS_WHITEBOARD, + ]; + return disallowedChannelTypes.indexOf(this.type) == -1; + } } export interface ChannelPermissionOverwrite {