mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 10:19:11 +02:00
Don't track unknown command AT ALL
This commit is contained in:
@@ -25,7 +25,10 @@ module.exports = class GroupLeaderboardCommand extends Command {
|
||||
|
||||
run(msg, { page }) {
|
||||
const groups = this.client.registry.groups.map(group => {
|
||||
const uses = group.commands.reduce((a, b) => a + (b.uses || 0), 0);
|
||||
const uses = group.commands.reduce((a, b) => {
|
||||
if (b.unknown || !b.uses) return a;
|
||||
return a + b.uses;
|
||||
}, 0);
|
||||
return { uses, group };
|
||||
});
|
||||
const totalPages = Math.ceil(this.client.registry.groups.size / 10);
|
||||
|
||||
@@ -21,7 +21,9 @@ module.exports = class LastRunCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, { command }) {
|
||||
if (command.lastRun === undefined) return msg.reply('That command\'s usage stats aren\'t being tracked.');
|
||||
if (command.unknown || command.lastRun === undefined) {
|
||||
return msg.reply('That command\'s usage stats aren\'t being tracked.');
|
||||
}
|
||||
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}**.`);
|
||||
|
||||
@@ -21,7 +21,9 @@ module.exports = class UsesCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, { command }) {
|
||||
if (command.uses === undefined) return msg.reply('That command\'s usage stats aren\'t being tracked.');
|
||||
if (command.unknown || command.uses === undefined) {
|
||||
return msg.reply('That command\'s usage stats aren\'t being tracked.');
|
||||
}
|
||||
return msg.say(`The \`${command.name}\` command has been used **${formatNumber(command.uses)}** times.`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user