summary refs log tree commit diff
path: root/util/src/models/VoiceState.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:33:02 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:33:02 +0200
commit4f2596789875b894e5b45d7cfafcc7cf6ca46aef (patch)
tree20b4728a0ff390bd982f2346807f3176efc8c1f9 /util/src/models/VoiceState.ts
parentMerge branch 'rtc' (diff)
downloadserver-4f2596789875b894e5b45d7cfafcc7cf6ca46aef.tar.xz
:sparkles: util
Diffstat (limited to 'util/src/models/VoiceState.ts')
-rw-r--r--util/src/models/VoiceState.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/util/src/models/VoiceState.ts b/util/src/models/VoiceState.ts
new file mode 100644
index 00000000..c1f90edd
--- /dev/null
+++ b/util/src/models/VoiceState.ts
@@ -0,0 +1,34 @@
+import { PublicMember } from "./Member";
+import { Schema, model, Types, Document } from "mongoose";
+import db from "../util/Database";
+
+export interface VoiceState extends Document {
+	guild_id?: string;
+	channel_id: string;
+	user_id: string;
+	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 VoiceSateSchema = new Schema({
+	guild_id: String,
+	channel_id: String,
+	user_id: String,
+	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
+});
+
+// @ts-ignore
+export const VoiceStateModel = db.model<VoiceState>("VoiceState", VoiceSateSchema, "voicestates");