summary refs log tree commit diff
path: root/src/models/Invite.ts
blob: 590a459869dff46418d2892be40a6bea823c7d91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Schema, Document, Types } from "mongoose";
import db from "../util/Database";

export interface Invite extends Document {
	code: string;
	temporary: boolean;
	uses: number;
	max_uses: number;
	max_age: number;
	created_at: Date;
	guild_id: string;
	channel_id: string;
	inviter_id: string;

	// ? What the fucking shit is this
	target_user_id?: string;
	target_user_type?: number;
}

export const InviteSchema = new Schema({
	code: String,
	temporary: Boolean,
	uses: Number,
	max_uses: Number,
	max_age: Number,
	created_at: Date,
	guild_id: String,
	channel_id: String,
	inviter_id: String,

	// ? What the fucking shit is this
	target_user_id: String,
	target_user_type: Number,
});

// @ts-ignore
export const InviteModel = db.model<Invite>("Invite", InviteSchema, "invites");