From 26d057627bc825c72a198af8866097363a77b048 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 22 Feb 2020 12:03:15 -0500 Subject: [PATCH] Hide owner only/hidden commands from help, Deps --- commands/util/help.js | 5 ++++- package.json | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/commands/util/help.js b/commands/util/help.js index 23416320..e4de7d96 100644 --- a/commands/util/help.js +++ b/commands/util/help.js @@ -29,9 +29,12 @@ module.exports = class HelpCommand extends Command { .setColor(0x00AE86) .setFooter(`${this.client.registry.commands.size} Commands`); for (const group of this.client.registry.groups.values()) { + const owner = this.client.isOwner(msg.author); + const commands = group.commands.filter(cmd => !cmd.hidden && owner ? true : !cmd.ownerOnly); + if (!commands.size) continue; embed.addField( `❯ ${group.name}`, - group.commands.map(cmd => `\`${cmd.name}\``).join(', ') || 'None' + commands.map(cmd => `\`${cmd.name}\``).join(', ') ); } try { diff --git a/package.json b/package.json index 7511f3d0..b4069c48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "110.6.0", + "version": "110.6.1", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": { @@ -43,17 +43,17 @@ "mathjs": "^6.6.0", "moment": "^2.24.0", "moment-duration-format": "^2.3.2", - "moment-timezone": "^0.5.27", + "moment-timezone": "^0.5.28", "node-opus": "^0.3.3", "node-superfetch": "^0.1.10", "random-js": "^2.1.0", - "soap": "^0.30.0", + "soap": "^0.31.0", "winston": "^3.2.1" }, "devDependencies": { "eslint": "^6.8.0", "eslint-config-amber": "^2.0.1", - "eslint-plugin-json": "^2.0.1" + "eslint-plugin-json": "^2.1.0" }, "eslintConfig": { "extends": "amber",