forked from engineering/cloudservices
Fix args lowercase
parent
af1827337f
commit
429a5fda8e
|
@ -45,15 +45,14 @@ export default class Util {
|
||||||
try {
|
try {
|
||||||
let resolvedCommand: Command;
|
let resolvedCommand: Command;
|
||||||
if (typeof query === 'string') query = query.split(' ');
|
if (typeof query === 'string') query = query.split(' ');
|
||||||
query = query.map((q) => q.toLowerCase());
|
|
||||||
const commands = this.client.commands.toArray();
|
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);
|
if (!resolvedCommand) return Promise.resolve(null);
|
||||||
query.shift();
|
query.shift();
|
||||||
while (resolvedCommand.subcommands.size) {
|
while (resolvedCommand.subcommands.size) {
|
||||||
const subCommands = resolvedCommand.subcommands.toArray();
|
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;
|
if (!found) break;
|
||||||
resolvedCommand = found;
|
resolvedCommand = found;
|
||||||
query.shift();
|
query.shift();
|
||||||
|
|
Loading…
Reference in New Issue