From 6c9a174da87c5b281d1aba4b366104aea937b64e Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 2 May 2024 14:23:00 -0400 Subject: [PATCH] Don't let users see usage stats for owner-only commands --- commands/util-public/last-run.js | 3 +++ commands/util-public/uses.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/commands/util-public/last-run.js b/commands/util-public/last-run.js index 99033f9b..7eeb6d32 100644 --- a/commands/util-public/last-run.js +++ b/commands/util-public/last-run.js @@ -23,6 +23,9 @@ module.exports = class LastRunCommand extends Command { if (command.unknown || command.lastRun === undefined) { return msg.reply('That command\'s usage stats aren\'t being tracked.'); } + if (command.ownerOnly && !this.client.isOwner(msg.author)) { + return msg.reply(`The \`${command.name}\` command can only be used by the bot owner(s).`); + } if (!command.lastRun) return msg.reply(`The \`${command.name}\` command has never been run.`); const displayTime = moment.utc(command.lastRun).format('MM/DD/YYYY h:mm A'); return msg.say(`The \`${command.name}\` command was last run on **${displayTime}**.`); diff --git a/commands/util-public/uses.js b/commands/util-public/uses.js index 72f93fac..0cd7d0f4 100644 --- a/commands/util-public/uses.js +++ b/commands/util-public/uses.js @@ -23,6 +23,9 @@ module.exports = class UsesCommand extends Command { if (command.unknown || command.uses === undefined) { return msg.reply('That command\'s usage stats aren\'t being tracked.'); } + if (command.ownerOnly && !this.client.isOwner(msg.author)) { + return msg.reply(`The \`${command.name}\` command can only be used by the bot owner(s).`); + } return msg.say(`The \`${command.name}\` command has been used **${formatNumber(command.uses)}** times.`); } };