Uses Command

This commit is contained in:
Dragon Fire
2020-06-01 23:43:30 -04:00
parent 51833e8483
commit 2a11f936ef
4 changed files with 31 additions and 3 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ module.exports = class CommandLeaderboardCommand extends Command {
let previousPts = null;
let positionsMoved = 1;
return this.client.registry.commands
.filter(command => command.uses !== undefined && !command.unknown && !command.hidden)
.filter(command => command.uses !== undefined)
.sort((a, b) => b.uses - a.uses)
.map(command => {
if (previousPts === command.uses) {
+27
View File
@@ -0,0 +1,27 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const { embedURL } = require('../../util/Util');
module.exports = class UsesCommand extends Command {
constructor(client) {
super(client, {
name: 'uses',
group: 'util',
memberName: 'uses',
description: 'Responds with a command\'s usage stats.',
guarded: true,
args: [
{
key: 'command',
prompt: 'Which command would you like to view the uses of?',
type: 'command'
}
]
});
}
run(msg, { command }) {
if (command.uses === undefined) return msg.say('This command\'s usage stats aren\'t being tracked.');
return msg.say(`The \`${command.name}\` command has been used **${command.uses}** times.`);
}
};