mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-23 10:52:30 +01:00
update Event
This commit is contained in:
parent
45f89d4531
commit
e77678799e
@ -10,7 +10,7 @@ import { Config } from "../../util/dist";
|
|||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const server = http.createServer();
|
const server = http.createServer();
|
||||||
const port = Number(process.env.PORT) || 8080;
|
const port = Number(process.env.PORT) || 3001;
|
||||||
const production = false;
|
const production = false;
|
||||||
server.on("request", app);
|
server.on("request", app);
|
||||||
|
|
||||||
|
@ -10,8 +10,6 @@ import { Message, PartialEmoji } from "./Message";
|
|||||||
import { VoiceState } from "./VoiceState";
|
import { VoiceState } from "./VoiceState";
|
||||||
import { ApplicationCommand } from "./Application";
|
import { ApplicationCommand } from "./Application";
|
||||||
import { Interaction } from "./Interaction";
|
import { Interaction } from "./Interaction";
|
||||||
import { Schema, model, Types, Document } from "mongoose";
|
|
||||||
import db from "../util/Database";
|
|
||||||
|
|
||||||
export interface Event {
|
export interface Event {
|
||||||
guild_id?: string;
|
guild_id?: string;
|
||||||
@ -22,20 +20,6 @@ export interface Event {
|
|||||||
data?: any;
|
data?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EventDocument extends Event, Document {}
|
|
||||||
|
|
||||||
export const EventSchema = new Schema({
|
|
||||||
guild_id: String,
|
|
||||||
user_id: String,
|
|
||||||
channel_id: String,
|
|
||||||
created_at: { type: Date, required: true },
|
|
||||||
event: { type: String, required: true },
|
|
||||||
data: Object,
|
|
||||||
});
|
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
export const EventModel = db.model<EventDocument>("Event", EventSchema, "events");
|
|
||||||
|
|
||||||
// ! Custom Events that shouldn't get sent to the client but processed by the server
|
// ! Custom Events that shouldn't get sent to the client but processed by the server
|
||||||
|
|
||||||
export interface InvalidatedEvent extends Event {
|
export interface InvalidatedEvent extends Event {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Channel, ConsumeMessage } from "amqplib";
|
import { Channel } from "amqplib";
|
||||||
import { EVENT, Event, EventModel } from "../models";
|
import { EVENT, Event } from "../models";
|
||||||
import { RabbitMQ } from "./RabbitMQ";
|
import { RabbitMQ } from "./RabbitMQ";
|
||||||
import EventEmitter from "events";
|
import EventEmitter from "events";
|
||||||
const events = new EventEmitter();
|
const events = new EventEmitter();
|
||||||
|
Loading…
Reference in New Issue
Block a user