From dd4996a85b0b6ce3c99b5600be86a090a3bc7dd6 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 11 May 2017 03:27:58 +0000 Subject: [PATCH] FriendlyError --- index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 686e8079..0c4bc803 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ const { TOKEN, OWNER, PREFIX, INVITE, CLEVS_KEY, CLEVS_USER, CLEVS_NICK } = process.env; -const { CommandoClient } = require('discord.js-commando'); +const { CommandoClient, FriendlyError } = require('discord.js-commando'); const client = new CommandoClient({ commandPrefix: PREFIX, owner: OWNER, @@ -59,7 +59,10 @@ client.on('error', console.error); client.on('warn', console.warn); -client.on('commandError', (command, err) => console.error(command, err)); +client.on('commandError', (command, err) => { + if (err instanceof FriendlyError) return; + console.error(command.name, err); +}); client.on('message', async (msg) => { if (msg.author.bot) return;