From aaeb35719f13319d4ba23dcb0c000e8729f1ed86 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sun, 27 Oct 2019 20:54:48 -0400 Subject: [PATCH] add event listeners on process in client --- src/Client.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Client.ts b/src/Client.ts index 2bba305..152c1ad 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -40,10 +40,17 @@ export default class Client extends Eris.Client { displayTimestamp: true, displayFilename: true, }); + this.events(); this.loadFunctions(); this.init(); } + private async events() { + process.on('unhandledRejection', (error) => { + this.signale.error(error); + }); + } + private async loadFunctions() { const functions = await fs.readdir('./functions'); functions.forEach(async (func) => {