summary refs log tree commit diff
path: root/src/models/VoiceState.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-13 09:30:21 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-13 09:30:21 +0100
commit8595646b72d42953814ffa2493630d15cfeeb857 (patch)
tree4cf5222fcab42d47f9642093ccffe289084daf19 /src/models/VoiceState.ts
parentmove guild arrays into seperate collections (diff)
downloadserver-8595646b72d42953814ffa2493630d15cfeeb857.tar.xz
:sparkles: mongoose Schemas
Diffstat (limited to 'src/models/VoiceState.ts')
-rw-r--r--src/models/VoiceState.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/models/VoiceState.ts b/src/models/VoiceState.ts

index 19a1bf27..8ac5ae19 100644 --- a/src/models/VoiceState.ts +++ b/src/models/VoiceState.ts
@@ -1,6 +1,7 @@ import { PublicMember } from "./Member"; +import { Schema, model, Types, Document } from "mongoose"; -export interface VoiceState { +export interface VoiceState extends Document { guild_id?: bigint; channel_id: bigint; user_id: bigint; @@ -13,3 +14,19 @@ export interface VoiceState { self_video: boolean; suppress: boolean; // whether this user is muted by the current user } + +export const VoiceSateSchema = new Schema({ + guild_id: Types.Long, + channel_id: Types.Long, + user_id: Types.Long, + session_id: String, + deaf: Boolean, + mute: Boolean, + self_deaf: Boolean, + self_mute: Boolean, + self_stream: Boolean, + self_video: Boolean, + suppress: Boolean, // whether this user is muted by the current user +}); + +export const VoiceStateModel = model<VoiceState>("VoiceState", VoiceSateSchema, "voicestates");