summary refs log tree commit diff
path: root/util/src/models/ReadState.ts
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/models/ReadState.ts')
-rw-r--r--util/src/models/ReadState.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/util/src/models/ReadState.ts b/util/src/models/ReadState.ts
new file mode 100644
index 00000000..9c4fb323
--- /dev/null
+++ b/util/src/models/ReadState.ts
@@ -0,0 +1,26 @@
+import { PublicMember } from "./Member";
+import { Schema, model, Types, Document } from "mongoose";
+import db from "../util/Database";
+
+export interface ReadState extends Document {
+	message_id: string;
+	channel_id: string;
+	user_id: string;
+	last_message_id?: string;
+	last_pin_timestamp?: Date;
+	mention_count: number;
+	manual: boolean;
+}
+
+export const ReadStateSchema = new Schema({
+	message_id: String,
+	channel_id: String,
+	user_id: String,
+	last_message_id: String,
+	last_pin_timestamp: Date,
+	mention_count: Number,
+	manual: Boolean,
+});
+
+// @ts-ignore
+export const ReadStateModel = db.model<ReadState>("ReadState", ReadStateSchema, "readstates");