From 8073b32fb86fe8ecdcced9b40841167aea55a691 Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Sun, 12 Jan 2025 12:46:24 -0600 Subject: [PATCH] fixregres --- src/handlers/event-utils.ts | 11 ++++++++--- src/handlers/interaction.ts | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/handlers/event-utils.ts b/src/handlers/event-utils.ts index 4d1e247..969618f 100644 --- a/src/handlers/event-utils.ts +++ b/src/handlers/event-utils.ts @@ -41,14 +41,19 @@ export function executeModule(emitter: Emitter, { module, args } : ExecutePayloa //do not await. this will block sern const moduleCalled = wrapAsync(async () => { - return module.execute(...args); + console.log(module) + return module.execute(...args); }) moduleCalled .then(() => { - emitter.emit('module.activate', resultPayload('success', module) ) + console.log('success execute') + emitter.emit('module.activate', resultPayload('success', module)) }) .catch(err => { - emitter.emit('error', resultPayload('failure', module, err)) + console.log('err', err) + if(!emitter.emit('error', resultPayload('failure', module, err))) { + console.error(err) + } }) }; diff --git a/src/handlers/interaction.ts b/src/handlers/interaction.ts index 09c37d4..0db538e 100644 --- a/src/handlers/interaction.ts +++ b/src/handlers/interaction.ts @@ -55,6 +55,6 @@ export function interactionHandler(deps: UnpackedDependencies, defaultPrefix?: s payload.args[1].state = result.value // note: do not await this. will be blocking if long task (ie waiting for modal input) - executeModule(reporter, { module, args: payload.args }); + executeModule(reporter, payload); }); }