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); }); }