mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Uses Command
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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.`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user