fix: crash on collectors (#89)

* fix: crash on collectors

* feat: bump version for bug fix
This commit is contained in:
Jacob Nguyen
2022-07-20 14:00:49 -05:00
committed by GitHub
parent d62be87c9a
commit a0587f59d4
2 changed files with 2 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@sern/handler",
"version": "1.1.5-beta",
"version": "1.1.6-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.payloadSubject.error(SernError.UndefinedModule);
this.wrapper?.sernEmitter?.emit('error', SernError.UndefinedModule);
} else {
//if statement above checks already, safe cast
this.payloadSubject.next(state as { event: Interaction; mod: CommandModule });