1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-07 19:32:34 +01:00

ReadState

This commit is contained in:
Flam3rboy 2021-07-22 14:23:30 +02:00
parent 43c560c210
commit 9af8df3baf

26
src/models/ReadState.ts Normal file
View File

@ -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");