Don't let users see usage stats for owner-only commands

This commit is contained in:
Dragon Fire
2024-05-02 14:23:00 -04:00
parent df9b5ac097
commit 6c9a174da8
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -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}**.`);
+3
View File
@@ -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.`);
}
};