mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 08:17:35 +02:00
Back
This commit is contained in:
+3
-3
@@ -12,7 +12,9 @@ const client = new CommandoClient({
|
|||||||
'VOICE_STATE_UPDATE',
|
'VOICE_STATE_UPDATE',
|
||||||
'FRIEND_ADD',
|
'FRIEND_ADD',
|
||||||
'FRIEND_REMOVE'
|
'FRIEND_REMOVE'
|
||||||
]
|
],
|
||||||
|
messageCacheLifetime: 60,
|
||||||
|
messageSweepInterval: 120
|
||||||
});
|
});
|
||||||
const { carbon, dBots, dBotsOrg, filterTopics, parseTopic } = require('./structures/Util');
|
const { carbon, dBots, dBotsOrg, filterTopics, parseTopic } = require('./structures/Util');
|
||||||
|
|
||||||
@@ -58,8 +60,6 @@ client.on('warn', console.warn);
|
|||||||
|
|
||||||
client.on('commandError', (command, err) => console.error(command.name, err));
|
client.on('commandError', (command, err) => console.error(command.name, err));
|
||||||
|
|
||||||
client.on('commandRun', command => ++command.uses);
|
|
||||||
|
|
||||||
client.on('message', async msg => {
|
client.on('message', async msg => {
|
||||||
if (!msg.guild || msg.author.bot) return;
|
if (!msg.guild || msg.author.bot) return;
|
||||||
const channel = filterTopics(msg.guild.channels, 'inviteguard');
|
const channel = filterTopics(msg.guild.channels, 'inviteguard');
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
const Command = require('../../structures/Command');
|
|
||||||
|
|
||||||
module.exports = class CommandLeaderboardCommand extends Command {
|
|
||||||
constructor(client) {
|
|
||||||
super(client, {
|
|
||||||
name: 'command-leaderboard',
|
|
||||||
aliases: ['cmd-leaderboard', 'cmd-board'],
|
|
||||||
group: 'util',
|
|
||||||
memberName: 'command-leaderboard',
|
|
||||||
description: 'Responds with the most used commands.',
|
|
||||||
details: '**Note:** This only counts this session for this shard.',
|
|
||||||
guarded: true,
|
|
||||||
args: [
|
|
||||||
{
|
|
||||||
key: 'page',
|
|
||||||
prompt: 'Which page do you want to view?',
|
|
||||||
type: 'integer',
|
|
||||||
default: 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
run(msg, args) {
|
|
||||||
const { page } = args;
|
|
||||||
let i = 0;
|
|
||||||
const list = this.client.registry.commands
|
|
||||||
.filter(cmd => !isNaN(cmd.uses))
|
|
||||||
.sort((a, b) => b.uses - a.uses)
|
|
||||||
.map(cmd => `**${++i}.** ${cmd.name} (${cmd.uses} Uses)`)
|
|
||||||
.slice((page - 1) * 10, page * 10);
|
|
||||||
if (!list.length) return msg.say('This page does not exist.');
|
|
||||||
return msg.say(list.join('\n'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "28.3.1",
|
"version": "29.0.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Shard.js",
|
"main": "Shard.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ class XiaoCommand extends Command {
|
|||||||
usages: 1,
|
usages: 1,
|
||||||
duration: 2
|
duration: 2
|
||||||
};
|
};
|
||||||
this.uses = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hasPermission(msg) {
|
hasPermission(msg) {
|
||||||
|
|||||||
Reference in New Issue
Block a user