fix: missing seyfert custom events

This commit is contained in:
MARCROCK22 2024-06-05 00:34:50 +00:00
parent 349628a587
commit 23be553844

View File

@ -1,9 +1,8 @@
import { import type {
type GatewayDispatchPayload, GatewayDispatchPayload,
type GatewayMessageCreateDispatch, GatewayMessageCreateDispatch,
type GatewayMessageDeleteBulkDispatch, GatewayMessageDeleteBulkDispatch,
type GatewayMessageDeleteDispatch, GatewayMessageDeleteDispatch,
GatewayDispatchEvents,
} from 'discord-api-types/v10'; } from 'discord-api-types/v10';
import type { Client, WorkerClient } from '../client'; import type { Client, WorkerClient } from '../client';
import { BaseHandler, ReplaceRegex, magicImport, type MakeRequired, type SnakeCase } from '../common'; import { BaseHandler, ReplaceRegex, magicImport, type MakeRequired, type SnakeCase } from '../common';
@ -27,9 +26,7 @@ export class EventHandler extends BaseHandler {
values: Partial<Record<GatewayEvents | CustomEventsKeys, EventValue>> = {}; values: Partial<Record<GatewayEvents | CustomEventsKeys, EventValue>> = {};
async load(eventsDir: string, instances?: { file: ClientEvent; path: string }[]) { async load(eventsDir: string, instances?: { file: ClientEvent; path: string }[]) {
const discordEvents = Object.values(GatewayDispatchEvents).map(x => const discordEvents = Object.keys(RawEvents).map(x => ReplaceRegex.camel(x.toLowerCase())) as ClientNameEvents[];
ReplaceRegex.camel(x.toLowerCase()),
) as ClientNameEvents[];
for (const i of instances ?? (await this.loadFilesK<ClientEvent>(await this.getFiles(eventsDir)))) { for (const i of instances ?? (await this.loadFilesK<ClientEvent>(await this.getFiles(eventsDir)))) {
const instance = this.callback(i.file); const instance = this.callback(i.file);