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
+2 -1
View File
@@ -224,7 +224,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 451
Total: 452
### Utility:
@@ -244,6 +244,7 @@ Total: 451
* **ping:** Checks the bot's ping to the Discord server.
* **report:** Reports something to the bot owner(s).
* **shutdown:** Shuts down the bot. (Owner-Only)
* **uses:** Responds with a command's usage stats.
### Discord Information:
+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.`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "115.1.5",
"version": "115.2.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {