Added ability to view only commands you have access to
This commit is contained in:
parent
d8fbddb351
commit
6068ee89e3
1 changed files with 3 additions and 1 deletions
|
@ -16,8 +16,10 @@ exports.run = async (client, message, args, level) => {
|
||||||
commands = client.commands(args[1]);
|
commands = client.commands(args[1]);
|
||||||
title = `== Commands under category ${args[1]} ==`;
|
title = `== Commands under category ${args[1]} ==`;
|
||||||
} else if(/^all|full|every$/i.test(args[0])) {
|
} else if(/^all|full|every$/i.test(args[0])) {
|
||||||
|
commands = message.guild ? client.commands ? client.commands.filter (cmd => cmd.conf.guildOnly !== true);
|
||||||
|
} else if(/^mine|usable$/i.test(args[0])) {
|
||||||
commands = message.guild ? client.commands.filter(cmd => client.levelCache[cmd.conf.permLevel] <= level) : client.commands.filter(cmd => client.levelCache[cmd.conf.permLevel] <= level && cmd.conf.guildOnly !== true);
|
commands = message.guild ? client.commands.filter(cmd => client.levelCache[cmd.conf.permLevel] <= level) : client.commands.filter(cmd => client.levelCache[cmd.conf.permLevel] <= level && cmd.conf.guildOnly !== true);
|
||||||
} else {
|
}
|
||||||
let command = args[0];
|
let command = args[0];
|
||||||
if (client.commands.has(command)) {
|
if (client.commands.has(command)) {
|
||||||
command = client.commands.get(command);
|
command = client.commands.get(command);
|
||||||
|
|
Loading…
Reference in a new issue