debug
This commit is contained in:
parent
3e43b568c1
commit
c6deb3764c
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "commandparser",
|
||||
"version": "1.0.20",
|
||||
"version": "1.0.21",
|
||||
"description": "Parser meant to parse commands and their options for discord bots",
|
||||
"main": "build/index.js",
|
||||
"author": "Navy.gif",
|
||||
|
@ -82,9 +82,16 @@ class Parser extends EventEmitter {
|
||||
|
||||
const command = this.matchCommand(commandName);
|
||||
if (!command) return null;
|
||||
if (commandFilter && typeof commandFilter === 'function' && await commandFilter(command)) return null;
|
||||
|
||||
this.debug(`Matched command ${command.name}`);
|
||||
|
||||
if (commandFilter && typeof commandFilter === 'function') {
|
||||
const result = await commandFilter(command);
|
||||
if (result) {
|
||||
this.debug(`Ignoring command ${command.name}`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const { subcommands, subcommandGroups } = command;
|
||||
const args: ArgsResult = {};
|
||||
const parseResult: ParseResult = { args, command, subcommand: null, subcommandGroup: null };
|
||||
|
Loading…
Reference in New Issue
Block a user