mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
fix: crash on collectors pt
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -54,4 +54,5 @@ export type SernEventsMapping = {
|
||||
['module.register']: [Payload];
|
||||
['module.activate']: [Payload];
|
||||
['error']: [Error | string];
|
||||
['warning']: [string];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user