From 4ec45ed190444e6e5ba8d45bac1f8f207221d95f Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Fri, 22 Apr 2022 15:43:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20now=20also=20catches=20Typeerror?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/handlers/commands.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/handlers/commands.ts b/src/handlers/commands.ts index dd4df30..db65603 100644 --- a/src/handlers/commands.ts +++ b/src/handlers/commands.ts @@ -15,19 +15,14 @@ export default async (client: Client) => { plugins.map(async (pluginName) => { const plugin = await import(`../plugins/${pluginName}`); - await client?.commands?.set( - plugin?.default?.data?.name, - plugin?.default - ); - - logger.verbose(`Loaded plugin: ${pluginName}`); + await client.commands.set(plugin.default.data.name, plugin.default); }) ) .then(async () => { logger.debug("Successfully loaded plugins."); }) .catch(async (err) => { - logger.error(err); + logger.error(`${err}`); }); }); };