From 775296d0048d290b959f07cde10a3ffc1430bad9 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 14 Feb 2021 20:41:40 +0100 Subject: :bug: fix Event type --- src/models/Channel.ts | 4 +++- src/models/Event.ts | 6 ++++-- src/models/Guild.ts | 8 ++++++-- src/models/Role.ts | 8 ++++++-- 4 files changed, 19 insertions(+), 7 deletions(-) (limited to 'src') 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", EventSchema, "events"); +export const EventModel = model("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", GuildSchema, "guilds"); +export const GuildModel = model("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", RoleSchema, "roles"); +export const RoleModel = model("Role", RoleSchema, "roles"); -- cgit 1.4.1