From 4b84ea832ff8b5bed53e4ed29cd9007d26542576 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Sun, 9 Oct 2022 18:16:10 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BD=D0=B4=20=D0=B2=20=D0=9B=D0=A1=20(=D0=9E=D0=BD?= =?UTF-8?q?=D0=B8=20=D0=B2=D1=81=D1=91=20=D1=8D=D1=82=D0=BE=20=D0=B2=D1=80?= =?UTF-8?q?=D0=B5=D0=BC=D1=8F=20=D0=BD=D0=B5=20=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0=D0=BB=D0=B8..)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/BaseCommand.js | 4 ++-- commands/General/help.js | 2 +- events/CommandHandler.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/BaseCommand.js b/base/BaseCommand.js index c6bd2d6d..fc848c75 100644 --- a/base/BaseCommand.js +++ b/base/BaseCommand.js @@ -14,11 +14,11 @@ class BaseCommand { /** * @type {Boolean} */ - this.guildOnly = options.guildOnly || true; + this.guildOnly = (options.guildOnly === true ? true : false) || false; /** * @type {Boolean} */ - this.ownerOnly = options.ownerOnly || false; + this.ownerOnly = (options.ownerOnly === true ? true : false) || false; this.dirname = options.dirname || false; /** * @type {String} diff --git a/commands/General/help.js b/commands/General/help.js index 3d0bb3ee..a1c463b8 100644 --- a/commands/General/help.js +++ b/commands/General/help.js @@ -16,7 +16,7 @@ class Help extends BaseCommand { .setDescription(client.translate("owner/reload:COMMAND"))), aliases: [], dirname: __dirname, - guildOnly: true, + guildOnly: false, ownerOnly: false }); } diff --git a/events/CommandHandler.js b/events/CommandHandler.js index 3b8eecee..92a908b6 100644 --- a/events/CommandHandler.js +++ b/events/CommandHandler.js @@ -26,7 +26,7 @@ class CommandHandler extends BaseEvent { data.userData = userData; if (command.guildOnly && !interaction.inGuild()) return interaction.replyT("misc:GUILD_ONLY", { ephemeral: true }); - if (command.ownerOnly && interaction.member.id !== client.config.owner.id) return interaction.replyT("misc:OWNER_ONLY", { ephemeral: true }); + if (command.ownerOnly && interaction.user.id !== client.config.owner.id) return interaction.replyT("misc:OWNER_ONLY", { ephemeral: true }); if (interaction.inGuild()) { const guildData = await client.findOrCreateGuild({