✨ Ban Model
This commit is contained in:
parent
64ab9e049a
commit
c3c6d9ac39
@ -1,6 +1,7 @@
|
|||||||
export * from "./util/checkToken";
|
export * from "./util/checkToken";
|
||||||
|
|
||||||
export * as Constants from "./util/Constants";
|
export * as Constants from "./util/Constants";
|
||||||
|
export * from "./models/Ban";
|
||||||
export * from "./models/Channel";
|
export * from "./models/Channel";
|
||||||
export * from "./models/Emoji";
|
export * from "./models/Emoji";
|
||||||
export * from "./models/Guild";
|
export * from "./models/Guild";
|
||||||
|
19
src/models/Ban.ts
Normal file
19
src/models/Ban.ts
Normal 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");
|
Loading…
x
Reference in New Issue
Block a user