Add total uses stat

This commit is contained in:
Dragon Fire
2024-07-02 01:16:09 -04:00
parent ed2e5bf017
commit 6139fccfb5
6 changed files with 23 additions and 3 deletions
@@ -32,6 +32,8 @@ module.exports = class CommandLeaderboardCommand extends Command {
return msg.say(stripIndents`
__**Command Usage Leaderboard (Page ${page}/${totalPages}):**__
${this.makeLeaderboard(commands, page).join('\n')}
_Total Uses: ${formatNumber(this.client.registry.totalUses)}_
`);
}
+1 -1
View File
@@ -27,7 +27,7 @@ module.exports = class InfoCommand extends Command {
.setFooter({ text: copyright.join('\n') })
.addField(' Servers', formatNumber(this.client.guilds.cache.size), true)
.addField(' Commands', formatNumber(this.client.registry.commands.size), true)
.addField(' Shards', formatNumber(this.client.options.shardCount), true)
.addField(' Total Usage', formatNumber(this.client.registry.totalUses), true)
.addField(' Home Server',
this.client.options.invite ? embedURL('Invite', this.client.options.invite) : 'None', true)
.addField(' Invite', embedURL('Add Me', invite), true)
+6 -1
View File
@@ -12,13 +12,18 @@ module.exports = class UsesCommand extends Command {
args: [
{
key: 'command',
type: 'command'
type: 'command',
default: ''
}
]
});
}
run(msg, { command }) {
if (!command) {
const uses = formatNumber(this.client.registry.totalUses);
return msg.say(`All commands have been used a total of **${uses}** times.`);
}
if (command.unknown || command.uses === undefined) {
return msg.reply('That command\'s usage stats aren\'t being tracked.');
}