Ban Model

This commit is contained in:
Flam3rboy 2021-02-19 15:34:32 +01:00
parent 64ab9e049a
commit c3c6d9ac39
2 changed files with 20 additions and 0 deletions

View File

@ -1,6 +1,7 @@
export * from "./util/checkToken";
export * as Constants from "./util/Constants";
export * from "./models/Ban";
export * from "./models/Channel";
export * from "./models/Emoji";
export * from "./models/Guild";

19
src/models/Ban.ts Normal file
View File

@ -0,0 +1,19 @@
import { Schema, model, Types, Document } from "mongoose";
import db from "../util/Database";
export interface Ban extends Document {
user_id: bigint;
guild_id: bigint;
ip: string;
reason?: string;
}
export const BanSchema = new Schema({
user_id: { type: Types.Long, required: true },
guild_id: { type: Types.Long, required: true },
reason: String,
ip: String, // ? Should we store this in here, or in the UserModel?
});
// @ts-ignore
export const BanModel = db.model<Ban>("Ban", BanSchema, "bans");