From f54d22beb796a4fd2bbeaf97ff4b204ac49c7c53 Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Sun, 3 Jul 2022 18:13:35 -0500 Subject: [PATCH] Change how No Permissions error is sent, add logging. --- commands/reload.js | 18 ++---------------- commands/restart.js | 2 +- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/commands/reload.js b/commands/reload.js index dab5b29..5684d5a 100644 --- a/commands/reload.js +++ b/commands/reload.js @@ -47,22 +47,8 @@ module.exports = { return returnMessage; } else { - return { - embeds: [{ - title: '<:AnitroxDenied:809651936642203668> **403 Forbidden**', - color: 13632027, - footer: { - icon_url: user.displayAvatarURL(), - text: config.footerTxt - }, - fields: [ - { - name: '**What Happened?**', - value: "You don't have the appropriate permissions to run this command!" - } - ] - }] - }; + console.error(`[SYSTEM] [ERR] User ${user.username} tried to reload ${args[0]}, but doesn't have permission!`); + return client.generateErrorMessage("You don't have permission to run this command.", user.displayAvatarURL()); } } }; diff --git a/commands/restart.js b/commands/restart.js index 0fd5ea8..992790d 100644 --- a/commands/restart.js +++ b/commands/restart.js @@ -43,7 +43,7 @@ module.exports = { } catch (e) { console.error(e); } } else { console.error('[SYSTEM] [ERR] User ' + user.username + " tried to restart the bot, but doesn't have permission! If this was you, Check your config.json"); - return client.generateErrorMessage('Only the bot owner can restart the bot! Stop.', user.displayAvatarURL()); + await channel.send(client.generateErrorMessage('You do not have permission to run this command.', user.displayAvatarURL())); } } };