mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-04 22:16:08 +00:00
fix: missing seyfert custom events
This commit is contained in:
parent
349628a587
commit
23be553844
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user