mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 13:56:43 +02:00
22.0.0
This commit is contained in:
@@ -37,17 +37,19 @@ module.exports = class HelpCommand extends Command {
|
||||
**Group:** ${commands[0].group.name}
|
||||
${commands[0].details || ''}
|
||||
`);
|
||||
} else return msg.say(`Could not identify command. Use \`${msg.usage(null)}\` to view a list of commands you can use.`);
|
||||
} else {
|
||||
return msg.say(`Could not identify command. Use \`${msg.usage(null)}\` to view a list of commands you can use.`);
|
||||
}
|
||||
} else {
|
||||
const embed = new RichEmbed()
|
||||
.setTitle(!showAll ? `Commands Available in ${msg.guild ? msg.guild.name : 'this DM'}` : 'All Commands')
|
||||
.setDescription(`Use \`${msg.usage('<command>')}\` to view detailed information about a specific command.`)
|
||||
.setColor(0x00AE86);
|
||||
for (const group of this.client.registry.groups.values()) {
|
||||
embed.addField(group.name,
|
||||
showAll ?
|
||||
group.commands.map(c => c.name).join(', ') :
|
||||
group.commands.filter(c => c.isUsable(msg)).map(c => c.name).join(', ') || 'None Available');
|
||||
embed.addField(`❯ ${group.name}`,
|
||||
showAll
|
||||
? group.commands.map((c) => c.name).join(', ')
|
||||
: group.commands.filter((c) => c.isUsable(msg)).map((c) => c.name).join(', ') || 'None Available');
|
||||
}
|
||||
try {
|
||||
await msg.direct({ embed });
|
||||
|
||||
+10
-14
@@ -1,6 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { oneLine } = require('common-tags');
|
||||
const { version } = require('../../package');
|
||||
const moment = require('moment');
|
||||
require('moment-duration-format');
|
||||
@@ -23,27 +22,24 @@ module.exports = class InfoCommand extends Command {
|
||||
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
|
||||
const embed = new RichEmbed()
|
||||
.setColor(0x00AE86)
|
||||
.setFooter(oneLine`
|
||||
©2017 dragonfire535#8081 |
|
||||
Created ${moment.duration(Date.now() - this.client.user.createdTimestamp).format('y[ years], M[ months], w[ weeks, and ]d[ days]')} ago!
|
||||
`)
|
||||
.addField('Servers',
|
||||
.setFooter('©2017 dragonfire535#8081')
|
||||
.addField('❯ Servers',
|
||||
guilds.reduce((prev, val) => prev + val, 0), true)
|
||||
.addField('Shards',
|
||||
.addField('❯ Shards',
|
||||
this.client.options.shardCount, true)
|
||||
.addField('Commands',
|
||||
.addField('❯ Commands',
|
||||
this.client.registry.commands.size, true)
|
||||
.addField('Source Code',
|
||||
.addField('❯ Source Code',
|
||||
'[View Here](https://github.com/dragonfire535/xiaobot)', true)
|
||||
.addField('Memory Usage',
|
||||
.addField('❯ Memory Usage',
|
||||
`${memory.reduce((prev, val) => prev + val, 0)}MB`, true)
|
||||
.addField('Uptime',
|
||||
.addField('❯ Uptime',
|
||||
moment.duration(this.client.uptime).format('d[d]h[h]m[m]s[s]'), true)
|
||||
.addField('Version',
|
||||
.addField('❯ Version',
|
||||
`v${version}`, true)
|
||||
.addField('Node Version',
|
||||
.addField('❯ Node Version',
|
||||
process.version, true)
|
||||
.addField('Library',
|
||||
.addField('❯ Library',
|
||||
'[discord.js](https://github.com/hydrabolt/discord.js)[-commando](https://github.com/Gawdl3y/discord.js-commando)', true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
|
||||
@@ -18,9 +18,12 @@ module.exports = class ShardInfoCommand extends Command {
|
||||
key: 'shard',
|
||||
prompt: 'Which Shard would you like to get data for?',
|
||||
type: 'integer',
|
||||
validate: shard => {
|
||||
if (shard < this.client.options.shardCount && shard > -1) return true;
|
||||
return 'Invalid Shard ID';
|
||||
validate: (shard) => {
|
||||
if (shard < this.client.options.shardCount && shard > -1) {
|
||||
return true;
|
||||
} else {
|
||||
return 'Invalid Shard ID';
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -35,11 +38,11 @@ module.exports = class ShardInfoCommand extends Command {
|
||||
const embed = new RichEmbed()
|
||||
.setTitle(`Shard ${shard}`)
|
||||
.setColor(0x00AE86)
|
||||
.addField('Servers',
|
||||
.addField('❯ Servers',
|
||||
guilds[shard], true)
|
||||
.addField('Memory Usage',
|
||||
.addField('❯ Memory Usage',
|
||||
`${memory[shard]}MB`, true)
|
||||
.addField('Uptime',
|
||||
.addField('❯ Uptime',
|
||||
moment.duration(uptime[shard]).format('d[d]h[h]m[m]s[s]'), true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user