diff --git a/lib/discord/src/patches/flux.ts b/lib/discord/src/patches/flux.ts index b32693b..bf1d08c 100644 --- a/lib/discord/src/patches/flux.ts +++ b/lib/discord/src/patches/flux.ts @@ -4,7 +4,7 @@ import type { FluxEventDispatchPatch } from '../flux/dispatcher' export const fPatchesAll: Set> = new Set() export const fPatches: Map>> = new Map() -const originalDispatch = Dispatcher.dispatch +const originalDispatch = Dispatcher.dispatch.bind(Dispatcher) Dispatcher.dispatch = payload => { let res: typeof payload | undefined | void = payload @@ -24,7 +24,7 @@ Dispatcher.dispatch = payload => { } catch {} } - if (res) return Reflect.apply(originalDispatch, Dispatcher, [res]) + if (res) return originalDispatch(res) // If res is undefined, the event is blocked return Promise.resolve() }