From 429a5fda8e63eeeb1dbbbef38cbc24e97750b227 Mon Sep 17 00:00:00 2001 From: Bsian Date: Sun, 1 Dec 2019 00:10:49 +0000 Subject: [PATCH] Fix args lowercase --- src/class/Util.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index cd48333..bad0b79 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -45,15 +45,14 @@ export default class Util { try { let resolvedCommand: Command; if (typeof query === 'string') query = query.split(' '); - query = query.map((q) => q.toLowerCase()); const commands = this.client.commands.toArray(); - resolvedCommand = commands.find((c) => c.name === query[0] || c.aliases.includes(query[0])); + resolvedCommand = commands.find((c) => c.name === query[0].toLowerCase() || c.aliases.includes(query[0].toLowerCase())); if (!resolvedCommand) return Promise.resolve(null); query.shift(); while (resolvedCommand.subcommands.size) { const subCommands = resolvedCommand.subcommands.toArray(); - const found = subCommands.find((c) => c.name === query[0] || c.aliases.includes(query[0])); + const found = subCommands.find((c) => c.name === query[0].toLowerCase() || c.aliases.includes(query[0].toLowerCase())); if (!found) break; resolvedCommand = found; query.shift();