From 7fb5a413696bb0e3b97dafa393547f5e06906cf8 Mon Sep 17 00:00:00 2001 From: ijsKoud Date: Mon, 5 Dec 2022 20:07:46 +0100 Subject: [PATCH] feat(Client): allow custom ErrorHandler --- src/lib/Client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/Client.ts b/src/lib/Client.ts index 0b7f259..df3ef26 100644 --- a/src/lib/Client.ts +++ b/src/lib/Client.ts @@ -11,7 +11,7 @@ export class IgloClient extends Client { public commandHandler: CommandHandler; public eventHandler: EventHandler; public interactionHandler: InteractionHandler; - public errorHandler = new ErrorHandler(this); + public errorHandler: ErrorHandler; public logger: Logger; @@ -22,6 +22,7 @@ export class IgloClient extends Client { this.commandHandler = new CommandHandler(this, options.paths.commands); this.eventHandler = new EventHandler(this, options.paths.events); this.interactionHandler = new InteractionHandler(this, options.paths.interactions); + this.errorHandler = options.errorHandler ?? new ErrorHandler(this); } /**