fix: revert name change

This commit is contained in:
QuantumlyTangled
2021-05-17 14:44:44 +02:00
parent 9382e2e921
commit a505ed48cb
3 changed files with 10 additions and 10 deletions

View File

@@ -1,10 +1,10 @@
import { eventHandlers, replaceEventHandlers } from "../bot.ts";
import type { EventHandlerFunctions } from "../types/discordeno/eventHandlers.ts";
import type { EventHandlers } from "../types/discordeno/eventHandlers.ts";
import type { EventEmitter } from "https://deno.land/std@0.96.0/node/events.ts";
export function proxyEvent(emitter: EventEmitter) {
replaceEventHandlers(new Proxy(eventHandlers, {
get(target, prop: keyof EventHandlerFunctions) {
get(target, prop: keyof EventHandlers) {
return target[prop] !== undefined ? target[prop] : ((...args: unknown[]) => emitter.emit(prop, ...args));
},
}));