Fix Everything

This commit is contained in:
Daniel Odendahl Jr
2017-06-01 18:31:20 +00:00
parent 66706d9c7b
commit 4e1f83a30f
85 changed files with 721 additions and 851 deletions
+5 -5
View File
@@ -38,18 +38,18 @@ module.exports = class HelpCommand extends Command {
${commands[0].details || ''}
`);
} else {
return msg.say(`Could not identify command. Use \`${msg.usage(null)}\` to view a list of commands you can use.`);
return msg.say(`Could not identify command. Use \`${msg.usage(null)}\` to view a list of commands.`);
}
} 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.`)
.setDescription(`Use \`${msg.usage('<command>')}\` to view detailed information about a 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');
showAll ?
group.commands.map((c) => c.name).join(', ') :
group.commands.filter((c) => c.isUsable(msg)).map((c) => c.name).join(', ') || 'None');
}
try {
await msg.direct({ embed });
+3 -3
View File
@@ -19,7 +19,7 @@ module.exports = class InfoCommand extends Command {
async run(msg) {
const guilds = await this.client.shard.fetchClientValues('guilds.size');
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
const memory = await this.client.shard.broadcastEval('process.memoryUsage().heapUsed');
const embed = new RichEmbed()
.setColor(0x00AE86)
.setFooter('©2017 dragonfire535#8081')
@@ -32,7 +32,7 @@ module.exports = class InfoCommand extends Command {
.addField(' Source Code',
'[View Here](https://github.com/dragonfire535/xiaobot)', true)
.addField(' Memory Usage',
`${memory.reduce((prev, val) => prev + val, 0)}MB`, true)
`${Math.round(memory.reduce((prev, val) => prev + val, 0)) / 1024 / 1024}MB`, true)
.addField(' Uptime',
moment.duration(this.client.uptime).format('d[d]h[h]m[m]s[s]'), true)
.addField(' Version',
@@ -40,7 +40,7 @@ module.exports = class InfoCommand extends Command {
.addField(' Node Version',
process.version, true)
.addField(' Library',
'[discord.js](https://github.com/hydrabolt/discord.js)[-commando](https://github.com/Gawdl3y/discord.js-commando)', true);
'[discord.js](https://discord.js.org)[-commando](https://github.com/Gawdl3y/discord.js-commando)', true); // eslint-disable-line max-len
return msg.embed(embed);
}
};
+4 -7
View File
@@ -19,11 +19,8 @@ module.exports = class ShardInfoCommand extends Command {
prompt: 'Which Shard would you like to get data for?',
type: 'integer',
validate: (shard) => {
if (shard < this.client.options.shardCount && shard > -1) {
return true;
} else {
return 'Invalid Shard ID';
}
if (shard < this.client.options.shardCount && shard > -1) return true;
else return 'Invalid Shard ID';
}
}
]
@@ -32,7 +29,7 @@ module.exports = class ShardInfoCommand extends Command {
async run(msg, args) {
const { shard } = args;
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
const memory = await this.client.shard.broadcastEval('process.memoryUsage().heapUsed');
const uptime = await this.client.shard.fetchClientValues('uptime');
const guilds = await this.client.shard.fetchClientValues('guilds.size');
const embed = new RichEmbed()
@@ -41,7 +38,7 @@ module.exports = class ShardInfoCommand extends Command {
.addField(' Servers',
guilds[shard], true)
.addField(' Memory Usage',
`${memory[shard]}MB`, true)
`${Math.round(memory[shard]) / 1024 / 1024}MB`, true)
.addField(' Uptime',
moment.duration(uptime[shard]).format('d[d]h[h]m[m]s[s]'), true);
return msg.embed(embed);
+1 -1
View File
@@ -14,6 +14,6 @@ module.exports = class UptimeCommand extends Command {
}
run(msg) {
return msg.say(`I've been active on this shard for: **${moment.duration(this.client.uptime).format('d[ days], h[ hours], m[ minutes, and ]s[ seconds]')}**!`);
return msg.say(moment.duration(this.client.uptime).format('d[ days], h[ hours], m[ minutes, and ]s[ seconds]'));
}
};