summary refs log tree commit diff
path: root/src/models/Invite.ts
blob: fc60b93c8f0683beed321b4e535a8015111d89ac (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
38
39
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: bigint;
	channel_id: bigint;
	inviter_id: bigint;

	//! What the fucking shit is this
	target_user_id?: bigint;
	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: Types.Long,
	channel_id: Types.Long,
	inviter_id: Types.Long,

	//! What the fucking shit is this
	target_user_id: Types.Long,
	target_user_type: Number,
	// !
});

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