This commit is contained in:
Daniel Odendahl Jr
2017-06-01 08:44:02 +00:00
parent 7802bb49cb
commit 14f85f94bd
129 changed files with 1915 additions and 1720 deletions
+7 -5
View File
@@ -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
View File
@@ -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);
}
+9 -6
View File
@@ -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);
}