From 4d6fd4634fbc9f8e853f19c180555907d6547705 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Mon, 5 Apr 2021 22:28:51 +0200 Subject: [PATCH] :sparkles: Event Enum --- dist/models/Event.d.ts | 42 ++++++++++++++++++++++++++++++++++++ dist/models/Event.js | 46 +++++++++++++++++++++++++++++++++++++++- dist/models/Event.js.map | 2 +- src/models/Event.ts | 43 +++++++++++++++++++++++++++++++++++++ 4 files changed, 131 insertions(+), 2 deletions(-) diff --git a/dist/models/Event.d.ts b/dist/models/Event.d.ts index eabde08a..b74930b9 100644 --- a/dist/models/Event.d.ts +++ b/dist/models/Event.d.ts @@ -353,5 +353,47 @@ export interface InteractionCreateEvent extends Event { event: "INTERACTION_CREATE"; data: Interaction; } +export declare enum EVENTEnum { + Ready = "READY", + ChannelCreate = "CHANNEL_CREATE", + ChannelUpdate = "CHANNEL_UPDATE", + ChannelDelete = "CHANNEL_DELETE", + ChannelPinsUpdate = "CHANNEL_PINS_UPDATE", + GuildCreate = "GUILD_CREATE", + GuildUpdate = "GUILD_UPDATE", + GuildDelete = "GUILD_DELETE", + GuildBanAdd = "GUILD_BAN_ADD", + GuildBanRemove = "GUILD_BAN_REMOVE", + GuildEmojUpdate = "GUILD_EMOJI_UPDATE", + GuildIntegrationsUpdate = "GUILD_INTEGRATIONS_UPDATE", + GuildMemberAdd = "GUILD_MEMBER_ADD", + GuildMemberRempve = "GUILD_MEMBER_REMOVE", + GuildMemberUpdate = "GUILD_MEMBER_UPDATE", + GuildMemberSpeaking = "GUILD_MEMBER_SPEAKING", + GuildMembersChunk = "GUILD_MEMBERS_CHUNK", + GuildRoleCreate = "GUILD_ROLE_CREATE", + GuildRoleDelete = "GUILD_ROLE_DELETE", + GuildRoleUpdate = "GUILD_ROLE_UPDATE", + InviteCreate = "INVITE_CREATE", + InviteDelete = "INVITE_DELETE", + MessageCreate = "MESSAGE_CREATE", + MessageUpdate = "MESSAGE_UPDATE", + MessageDelete = "MESSAGE_DELETE", + MessageDeleteBulk = "MESSAGE_DELETE_BULK", + MessageReactionAdd = "MESSAGE_REACTION_ADD", + MessageReactionRemove = "MESSAGE_REACTION_REMOVE", + MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL", + MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI", + PresenceUpdate = "PRESENCE_UPDATE", + TypingStart = "TYPING_START", + UserUpdate = "USER_UPDATE", + WebhooksUpdate = "WEBHOOKS_UPDATE", + InteractionCreate = "INTERACTION_CREATE", + VoiceStateUpdate = "VOICE_STATE_UPDATE", + VoiceServerUpdate = "VOICE_SERVER_UPDATE", + ApplicationCommandCreate = "APPLICATION_COMMAND_CREATE", + ApplicationCommandUpdate = "APPLICATION_COMMAND_UPDATE", + ApplicationCommandDelete = "APPLICATION_COMMAND_DELETE" +} export declare type EVENT = "READY" | "CHANNEL_CREATE" | "CHANNEL_UPDATE" | "CHANNEL_DELETE" | "CHANNEL_PINS_UPDATE" | "GUILD_CREATE" | "GUILD_UPDATE" | "GUILD_DELETE" | "GUILD_BAN_ADD" | "GUILD_BAN_REMOVE" | "GUILD_EMOJI_UPDATE" | "GUILD_INTEGRATIONS_UPDATE" | "GUILD_MEMBER_ADD" | "GUILD_MEMBER_REMOVE" | "GUILD_MEMBER_UPDATE" | "GUILD_MEMBER_SPEAKING" | "GUILD_MEMBERS_CHUNK" | "GUILD_ROLE_CREATE" | "GUILD_ROLE_DELETE" | "GUILD_ROLE_UPDATE" | "INVITE_CREATE" | "INVITE_DELETE" | "MESSAGE_CREATE" | "MESSAGE_UPDATE" | "MESSAGE_DELETE" | "MESSAGE_DELETE_BULK" | "MESSAGE_REACTION_ADD" | "MESSAGE_REACTION_REMOVE" | "MESSAGE_REACTION_REMOVE_ALL" | "MESSAGE_REACTION_REMOVE_EMOJI" | "PRESENCE_UPDATE" | "TYPING_START" | "USER_UPDATE" | "WEBHOOKS_UPDATE" | "INTERACTION_CREATE" | "VOICE_STATE_UPDATE" | "VOICE_SERVER_UPDATE" | "APPLICATION_COMMAND_CREATE" | "APPLICATION_COMMAND_UPDATE" | "APPLICATION_COMMAND_DELETE" | CUSTOMEVENTS; export declare type CUSTOMEVENTS = "INVALIDATED"; diff --git a/dist/models/Event.js b/dist/models/Event.js index 76ba96ff..d6eb6f6e 100644 --- a/dist/models/Event.js +++ b/dist/models/Event.js @@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.EventModel = exports.EventSchema = void 0; +exports.EVENTEnum = exports.EventModel = exports.EventSchema = void 0; const mongoose_1 = require("mongoose"); const Database_1 = __importDefault(require("../util/Database")); exports.EventSchema = new mongoose_1.Schema({ @@ -16,4 +16,48 @@ exports.EventSchema = new mongoose_1.Schema({ }); // @ts-ignore exports.EventModel = Database_1.default.model("Event", exports.EventSchema, "events"); +// located in collection events +var EVENTEnum; +(function (EVENTEnum) { + EVENTEnum["Ready"] = "READY"; + EVENTEnum["ChannelCreate"] = "CHANNEL_CREATE"; + EVENTEnum["ChannelUpdate"] = "CHANNEL_UPDATE"; + EVENTEnum["ChannelDelete"] = "CHANNEL_DELETE"; + EVENTEnum["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE"; + EVENTEnum["GuildCreate"] = "GUILD_CREATE"; + EVENTEnum["GuildUpdate"] = "GUILD_UPDATE"; + EVENTEnum["GuildDelete"] = "GUILD_DELETE"; + EVENTEnum["GuildBanAdd"] = "GUILD_BAN_ADD"; + EVENTEnum["GuildBanRemove"] = "GUILD_BAN_REMOVE"; + EVENTEnum["GuildEmojUpdate"] = "GUILD_EMOJI_UPDATE"; + EVENTEnum["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE"; + EVENTEnum["GuildMemberAdd"] = "GUILD_MEMBER_ADD"; + EVENTEnum["GuildMemberRempve"] = "GUILD_MEMBER_REMOVE"; + EVENTEnum["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE"; + EVENTEnum["GuildMemberSpeaking"] = "GUILD_MEMBER_SPEAKING"; + EVENTEnum["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK"; + EVENTEnum["GuildRoleCreate"] = "GUILD_ROLE_CREATE"; + EVENTEnum["GuildRoleDelete"] = "GUILD_ROLE_DELETE"; + EVENTEnum["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE"; + EVENTEnum["InviteCreate"] = "INVITE_CREATE"; + EVENTEnum["InviteDelete"] = "INVITE_DELETE"; + EVENTEnum["MessageCreate"] = "MESSAGE_CREATE"; + EVENTEnum["MessageUpdate"] = "MESSAGE_UPDATE"; + EVENTEnum["MessageDelete"] = "MESSAGE_DELETE"; + EVENTEnum["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK"; + EVENTEnum["MessageReactionAdd"] = "MESSAGE_REACTION_ADD"; + EVENTEnum["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE"; + EVENTEnum["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL"; + EVENTEnum["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI"; + EVENTEnum["PresenceUpdate"] = "PRESENCE_UPDATE"; + EVENTEnum["TypingStart"] = "TYPING_START"; + EVENTEnum["UserUpdate"] = "USER_UPDATE"; + EVENTEnum["WebhooksUpdate"] = "WEBHOOKS_UPDATE"; + EVENTEnum["InteractionCreate"] = "INTERACTION_CREATE"; + EVENTEnum["VoiceStateUpdate"] = "VOICE_STATE_UPDATE"; + EVENTEnum["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE"; + EVENTEnum["ApplicationCommandCreate"] = "APPLICATION_COMMAND_CREATE"; + EVENTEnum["ApplicationCommandUpdate"] = "APPLICATION_COMMAND_UPDATE"; + EVENTEnum["ApplicationCommandDelete"] = "APPLICATION_COMMAND_DELETE"; +})(EVENTEnum = exports.EVENTEnum || (exports.EVENTEnum = {})); //# sourceMappingURL=Event.js.map \ No newline at end of file diff --git a/dist/models/Event.js.map b/dist/models/Event.js.map index 7a096d42..bb43d136 100644 --- a/dist/models/Event.js.map +++ b/dist/models/Event.js.map @@ -1 +1 @@ -{"version":3,"file":"Event.js","sourceRoot":"","sources":["../../src/models/Event.ts"],"names":[],"mappings":";;;;;;AAYA,uCAA0D;AAC1D,gEAAkC;AAarB,QAAA,WAAW,GAAG,IAAI,iBAAM,CAAC;IACrC,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,OAAO,EAAE,gBAAK,CAAC,IAAI;IACnB,UAAU,EAAE,gBAAK,CAAC,IAAI;IACtB,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC1C,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACvC,IAAI,EAAE,MAAM;CACZ,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,UAAU,GAAG,kBAAE,CAAC,KAAK,CAAgB,OAAO,EAAE,mBAAW,EAAE,QAAQ,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"Event.js","sourceRoot":"","sources":["../../src/models/Event.ts"],"names":[],"mappings":";;;;;;AAYA,uCAA0D;AAC1D,gEAAkC;AAarB,QAAA,WAAW,GAAG,IAAI,iBAAM,CAAC;IACrC,QAAQ,EAAE,gBAAK,CAAC,IAAI;IACpB,OAAO,EAAE,gBAAK,CAAC,IAAI;IACnB,UAAU,EAAE,gBAAK,CAAC,IAAI;IACtB,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC1C,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACvC,IAAI,EAAE,MAAM;CACZ,CAAC,CAAC;AAEH,aAAa;AACA,QAAA,UAAU,GAAG,kBAAE,CAAC,KAAK,CAAgB,OAAO,EAAE,mBAAW,EAAE,QAAQ,CAAC,CAAC;AAgXlF,+BAA+B;AAE/B,IAAY,SAyCX;AAzCD,WAAY,SAAS;IACpB,4BAAe,CAAA;IACf,6CAAgC,CAAA;IAChC,6CAAgC,CAAA;IAChC,6CAAgC,CAAA;IAChC,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,yCAA4B,CAAA;IAC5B,yCAA4B,CAAA;IAC5B,0CAA6B,CAAA;IAC7B,gDAAmC,CAAA;IACnC,mDAAsC,CAAA;IACtC,kEAAqD,CAAA;IACrD,gDAAmC,CAAA;IACnC,sDAAyC,CAAA;IACzC,sDAAyC,CAAA;IACzC,0DAA6C,CAAA;IAC7C,sDAAyC,CAAA;IACzC,kDAAqC,CAAA;IACrC,kDAAqC,CAAA;IACrC,kDAAqC,CAAA;IACrC,2CAA8B,CAAA;IAC9B,2CAA8B,CAAA;IAC9B,6CAAgC,CAAA;IAChC,6CAAgC,CAAA;IAChC,6CAAgC,CAAA;IAChC,sDAAyC,CAAA;IACzC,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,qEAAwD,CAAA;IACxD,yEAA4D,CAAA;IAC5D,+CAAkC,CAAA;IAClC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,+CAAkC,CAAA;IAClC,qDAAwC,CAAA;IACxC,oDAAuC,CAAA;IACvC,sDAAyC,CAAA;IACzC,oEAAuD,CAAA;IACvD,oEAAuD,CAAA;IACvD,oEAAuD,CAAA;AACxD,CAAC,EAzCW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAyCpB"} \ No newline at end of file diff --git a/src/models/Event.ts b/src/models/Event.ts index 40cbcb20..9d328b00 100644 --- a/src/models/Event.ts +++ b/src/models/Event.ts @@ -404,6 +404,49 @@ export interface InteractionCreateEvent extends Event { // located in collection events +export enum EVENTEnum { + Ready = "READY", + ChannelCreate = "CHANNEL_CREATE", + ChannelUpdate = "CHANNEL_UPDATE", + ChannelDelete = "CHANNEL_DELETE", + ChannelPinsUpdate = "CHANNEL_PINS_UPDATE", + GuildCreate = "GUILD_CREATE", + GuildUpdate = "GUILD_UPDATE", + GuildDelete = "GUILD_DELETE", + GuildBanAdd = "GUILD_BAN_ADD", + GuildBanRemove = "GUILD_BAN_REMOVE", + GuildEmojUpdate = "GUILD_EMOJI_UPDATE", + GuildIntegrationsUpdate = "GUILD_INTEGRATIONS_UPDATE", + GuildMemberAdd = "GUILD_MEMBER_ADD", + GuildMemberRempve = "GUILD_MEMBER_REMOVE", + GuildMemberUpdate = "GUILD_MEMBER_UPDATE", + GuildMemberSpeaking = "GUILD_MEMBER_SPEAKING", + GuildMembersChunk = "GUILD_MEMBERS_CHUNK", + GuildRoleCreate = "GUILD_ROLE_CREATE", + GuildRoleDelete = "GUILD_ROLE_DELETE", + GuildRoleUpdate = "GUILD_ROLE_UPDATE", + InviteCreate = "INVITE_CREATE", + InviteDelete = "INVITE_DELETE", + MessageCreate = "MESSAGE_CREATE", + MessageUpdate = "MESSAGE_UPDATE", + MessageDelete = "MESSAGE_DELETE", + MessageDeleteBulk = "MESSAGE_DELETE_BULK", + MessageReactionAdd = "MESSAGE_REACTION_ADD", + MessageReactionRemove = "MESSAGE_REACTION_REMOVE", + MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL", + MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI", + PresenceUpdate = "PRESENCE_UPDATE", + TypingStart = "TYPING_START", + UserUpdate = "USER_UPDATE", + WebhooksUpdate = "WEBHOOKS_UPDATE", + InteractionCreate = "INTERACTION_CREATE", + VoiceStateUpdate = "VOICE_STATE_UPDATE", + VoiceServerUpdate = "VOICE_SERVER_UPDATE", + ApplicationCommandCreate = "APPLICATION_COMMAND_CREATE", + ApplicationCommandUpdate = "APPLICATION_COMMAND_UPDATE", + ApplicationCommandDelete = "APPLICATION_COMMAND_DELETE", +} + export type EVENT = | "READY" | "CHANNEL_CREATE"