🐛 fix Event type

This commit is contained in:
Flam3rboy committed 2021-02-14 20:41:40 +01:00
1 parent 2859daeba8
commit 775296d004
12 files changed
+40 -18

No files matched your search

+3 -1
View File
@@ -1,6 +1,8 @@
import { Schema, model, Types, Document } from "mongoose";
export interface ChannelDocument extends Channel, DMChannel, TextChannel, VoiceChannel, Document {
export interface AnyChannel extends Channel, DMChannel, TextChannel, VoiceChannel {}
export interface ChannelDocument extends Document, AnyChannel {
id: bigint;
}
+4 -2
View File
@@ -12,7 +12,7 @@ import { ApplicationCommand } from "./Application";
import { Interaction } from "./Interaction";
import { Schema, model, Types, Document } from "mongoose";
export interface Event extends Document {
export interface Event {
guild_id?: bigint;
user_id?: bigint;
channel_id?: bigint;
@@ -21,6 +21,8 @@ export interface Event extends Document {
data?: any;
}
export interface EventDocument extends Event, Document {}
export const EventSchema = new Schema({
guild_id: Types.Long,
user_id: Types.Long,
@@ -30,7 +32,7 @@ export const EventSchema = new Schema({
data: Object,
});
export const EventModel = model<Event>("Event", EventSchema, "events");
export const EventModel = model<EventDocument>("Event", EventSchema, "events");
// ! Custom Events that shouldn't get sent to the client but processed by the server
+6 -2
View File
@@ -1,6 +1,10 @@
import { Schema, model, Types, Document } from "mongoose";
export interface Guild extends Document {
export interface GuildDocument extends Document, Guild {
id: bigint;
}
export interface Guild {
id: bigint;
afk_channel_id?: bigint;
afk_timeout?: number;
@@ -82,4 +86,4 @@ export const GuildSchema = new Schema({
widget_enabled: Boolean,
});
export const GuildModel = model<Guild>("Guild", GuildSchema, "guilds");
export const GuildModel = model<GuildDocument>("Guild", GuildSchema, "guilds");
+6 -2
View File
@@ -1,6 +1,6 @@
import { Schema, model, Types, Document } from "mongoose";
export interface Role extends Document {
export interface Role {
id: bigint;
guild_id: bigint;
color: number;
@@ -15,6 +15,10 @@ export interface Role extends Document {
};
}
export interface RoleDocument extends Document, Role {
id: bigint;
}
export const RoleSchema = new Schema({
id: Types.Long,
guild_id: Types.Long,
@@ -30,4 +34,4 @@ export const RoleSchema = new Schema({
},
});
export const RoleModel = model<Role>("Role", RoleSchema, "roles");
export const RoleModel = model<RoleDocument>("Role", RoleSchema, "roles");