diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-09-25 11:10:27 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-09-25 11:10:27 +1000 |
commit | 1f4f6c555f49c94ac29b00ba069203553b12a611 (patch) | |
tree | 46b86c70b1bf6f764725f011f8041746fdac4cf8 /util/src/entities/Member.ts | |
parent | Committed the wrong rights script (diff) | |
download | server-1f4f6c555f49c94ac29b00ba069203553b12a611.tar.xz |
Mostly working user guild settings
Diffstat (limited to 'util/src/entities/Member.ts')
-rw-r--r-- | util/src/entities/Member.ts | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/util/src/entities/Member.ts b/util/src/entities/Member.ts index c2bc65c4..03698453 100644 --- a/util/src/entities/Member.ts +++ b/util/src/entities/Member.ts @@ -80,7 +80,7 @@ export class Member extends BaseClassWithoutId { val = val.split("\t").join(""); if (BannedWords.find(val)) throw FieldErrors({ nick: { message: "Bad nickname", code: "INVALID_NICKNAME" } }); } - + this.nick = val; } @@ -339,20 +339,52 @@ export class Member extends BaseClassWithoutId { } } +export interface ChannelOverride { + message_notifications: number; + mute_config: MuteConfig; + muted: boolean; + channel_id: string | null; +} + export interface UserGuildSettings { + // channel_overrides: { + // channel_id: string; + // message_notifications: number; + // mute_config: MuteConfig; + // muted: boolean; + // }[]; + channel_overrides: { - channel_id: string; - message_notifications: number; - mute_config: MuteConfig; - muted: boolean; - }[]; + [channel_id: string]: ChannelOverride; + } | null, message_notifications: number; mobile_push: boolean; - mute_config: MuteConfig; + mute_config: MuteConfig | null; muted: boolean; suppress_everyone: boolean; suppress_roles: boolean; version: number; + guild_id: string | null; + flags: number; + mute_scheduled_events: boolean; + hide_muted_channels: boolean; + notify_highlights: 0; +} + +export const DefaultUserGuildSettings: UserGuildSettings = { + channel_overrides: null, + message_notifications: 1, + flags: 0, + hide_muted_channels: false, + mobile_push: true, + mute_config: null, + mute_scheduled_events: false, + muted: false, + notify_highlights: 0, + suppress_everyone: false, + suppress_roles: false, + version: 453, // ? + guild_id: null, } export interface MuteConfig { |