mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 14:21:41 +02:00
Don't let users see usage stats for owner-only commands
This commit is contained in:
@@ -23,6 +23,9 @@ module.exports = class LastRunCommand extends Command {
|
|||||||
if (command.unknown || command.lastRun === undefined) {
|
if (command.unknown || command.lastRun === undefined) {
|
||||||
return msg.reply('That command\'s usage stats aren\'t being tracked.');
|
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.`);
|
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');
|
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}**.`);
|
return msg.say(`The \`${command.name}\` command was last run on **${displayTime}**.`);
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ module.exports = class UsesCommand extends Command {
|
|||||||
if (command.unknown || command.uses === undefined) {
|
if (command.unknown || command.uses === undefined) {
|
||||||
return msg.reply('That command\'s usage stats aren\'t being tracked.');
|
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.`);
|
return msg.say(`The \`${command.name}\` command has been used **${formatNumber(command.uses)}** times.`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user