fix: crash on collectors pt

This commit is contained in:
Jacob Nguyen
2022-07-20 14:36:32 -05:00
parent a0587f59d4
commit 7da7bff700
3 changed files with 3 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@sern/handler",
"version": "1.1.6-beta",
"version": "1.1.7-beta",
"description": "A customizable, batteries-included, powerful discord.js framework to automate and streamline bot development.",
"main": "dist/index.js",
"scripts": {

View File

@@ -89,7 +89,7 @@ export default class InteractionHandler extends EventsHandler<{
protected setState(state: { event: Interaction; mod: CommandModule | undefined }): void {
if (state.mod === undefined) {
this.wrapper?.sernEmitter?.emit('error', SernError.UndefinedModule);
this.wrapper?.sernEmitter?.emit('warning', 'Found no module for this interaction');
} else {
//if statement above checks already, safe cast
this.payloadSubject.next(state as { event: Interaction; mod: CommandModule });

View File

@@ -54,4 +54,5 @@ export type SernEventsMapping = {
['module.register']: [Payload];
['module.activate']: [Payload];
['error']: [Error | string];
['warning']: [string];
};