mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 10:02:05 +02:00
Code Improvements
This commit is contained in:
@@ -19,7 +19,7 @@ module.exports = class InfoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
@@ -33,7 +33,7 @@ module.exports = class InfoCommand extends Command {
|
||||
.addField('Shards',
|
||||
`${this.client.options.shardCount} (${this.client.shard.id})`, true)
|
||||
.addField('Commands',
|
||||
'108', true)
|
||||
'106', true)
|
||||
.addField('Owner',
|
||||
'dragonfire535#8081', true)
|
||||
.addField('Source Code',
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
|
||||
module.exports = class ServersCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'servers',
|
||||
aliases: [
|
||||
'serverlist'
|
||||
],
|
||||
group: 'util',
|
||||
memberName: 'servers',
|
||||
description: 'Sends a list of all server names and IDs to the log. (;servers)',
|
||||
examples: [';servers']
|
||||
});
|
||||
}
|
||||
hasPermission(msg) {
|
||||
return this.client.isOwner(msg.author);
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const guildCount = this.client.guilds.size;
|
||||
const guildNames = this.client.guilds.map(g => `${g.name} (${g.id})`).join(', ');
|
||||
console.log(`${guildCount} Servers: ${guildNames}`);
|
||||
return message.say('Sent the information to the console!');
|
||||
}
|
||||
};
|
||||
@@ -32,9 +32,7 @@ module.exports = class ShardInfoCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const shardID = args.shardID;
|
||||
if (shardID > this.client.options.shardCount - 1 || shardID < 0) {
|
||||
return message.say(':x: Error! Invalid Shard!');
|
||||
}
|
||||
if (shardID > this.client.options.shardCount - 1 || shardID < 0) return message.say(':x: Error! Invalid Shard!');
|
||||
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
|
||||
const uptime = await this.client.shard.fetchClientValues('uptime');
|
||||
const guilds = await this.client.shard.fetchClientValues('guilds.size');
|
||||
|
||||
Reference in New Issue
Block a user