mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 10:25:11 +02:00
Uses Command
This commit is contained in:
@@ -224,7 +224,7 @@ in the appropriate channel's topic to use it.
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
Total: 451
|
Total: 452
|
||||||
|
|
||||||
### Utility:
|
### Utility:
|
||||||
|
|
||||||
@@ -244,6 +244,7 @@ Total: 451
|
|||||||
* **ping:** Checks the bot's ping to the Discord server.
|
* **ping:** Checks the bot's ping to the Discord server.
|
||||||
* **report:** Reports something to the bot owner(s).
|
* **report:** Reports something to the bot owner(s).
|
||||||
* **shutdown:** Shuts down the bot. (Owner-Only)
|
* **shutdown:** Shuts down the bot. (Owner-Only)
|
||||||
|
* **uses:** Responds with a command's usage stats.
|
||||||
|
|
||||||
### Discord Information:
|
### Discord Information:
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ module.exports = class CommandLeaderboardCommand extends Command {
|
|||||||
let previousPts = null;
|
let previousPts = null;
|
||||||
let positionsMoved = 1;
|
let positionsMoved = 1;
|
||||||
return this.client.registry.commands
|
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)
|
.sort((a, b) => b.uses - a.uses)
|
||||||
.map(command => {
|
.map(command => {
|
||||||
if (previousPts === command.uses) {
|
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.`);
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "115.1.5",
|
"version": "115.2.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user