mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 01:57:54 +02:00
Change Variable Names, Remove Useless Commands
This commit is contained in:
@@ -15,7 +15,7 @@ module.exports = class ShardInfoCommand extends Command {
|
||||
memberName: 'shardinfo',
|
||||
description: 'Gives some bot info for the Shard you specify.',
|
||||
args: [{
|
||||
key: 'shardID',
|
||||
key: 'shard',
|
||||
prompt: 'Which Shard would you like to get data for?',
|
||||
type: 'integer'
|
||||
}]
|
||||
@@ -26,26 +26,21 @@ module.exports = class ShardInfoCommand extends Command {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { shardID } = args;
|
||||
if (shardID > this.client.options.shardCount - 1 || shardID < 0)
|
||||
const { shard } = args;
|
||||
if (shard > this.client.options.shardCount - 1 || shard < 0)
|
||||
return message.say('The Shard ID is not valid.');
|
||||
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');
|
||||
const embed = new RichEmbed()
|
||||
.setTitle(`Data for Shard ${shard}:`)
|
||||
.setColor(0x00AE86)
|
||||
.addField('Servers',
|
||||
guilds[shardID], true)
|
||||
.addField('Shard ID',
|
||||
shardID, true)
|
||||
guilds[shard], true)
|
||||
.addField('Memory Usage',
|
||||
`${memory[shardID]}MB`, true)
|
||||
`${memory[shard]}MB`, true)
|
||||
.addField('Uptime',
|
||||
moment.duration(uptime[shardID]).format('d[d]h[h]m[m]s[s]'), true)
|
||||
.addField('Version',
|
||||
version, true)
|
||||
.addField('Node Version',
|
||||
process.version, true);
|
||||
moment.duration(uptime[shard]).format('d[d]h[h]m[m]s[s]'), true);
|
||||
return message.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user