mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-24 04:13:32 +00:00
🐛 fix Event type
This commit is contained in:
1 parent
2859daeba8
commit
775296d004
12 files changed
+40
-18
No files matched your search
@@ -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
@@ -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
@@ -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
@@ -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");
|
||||
Reference in new issue
Block a user