summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-14 20:41:40 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-14 20:41:40 +0100
commit775296d0048d290b959f07cde10a3ffc1430bad9 (patch)
treeb622b48450641cb044a1b3f4500306d95f748205 /src
parent:bug: fix permission (diff)
downloadserver-775296d0048d290b959f07cde10a3ffc1430bad9.tar.xz
:bug: fix Event type
Diffstat (limited to 'src')
-rw-r--r--src/models/Channel.ts4
-rw-r--r--src/models/Event.ts6
-rw-r--r--src/models/Guild.ts8
-rw-r--r--src/models/Role.ts8
4 files changed, 19 insertions, 7 deletions
diff --git a/src/models/Channel.ts b/src/models/Channel.ts
index 3c63f80f..57e75f26 100644
--- a/src/models/Channel.ts
+++ b/src/models/Channel.ts
@@ -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;
 }
 
diff --git a/src/models/Event.ts b/src/models/Event.ts
index 4e2736c0..515c6119 100644
--- a/src/models/Event.ts
+++ b/src/models/Event.ts
@@ -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
 
diff --git a/src/models/Guild.ts b/src/models/Guild.ts
index c9a55301..11629fb5 100644
--- a/src/models/Guild.ts
+++ b/src/models/Guild.ts
@@ -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");
diff --git a/src/models/Role.ts b/src/models/Role.ts
index b6cba2f8..a8d03373 100644
--- a/src/models/Role.ts
+++ b/src/models/Role.ts
@@ -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");