Clean-Ups

This commit is contained in:
Daniel Odendahl Jr
2017-05-31 04:41:01 +00:00
parent 21ebcf8537
commit 7802bb49cb
142 changed files with 351 additions and 495 deletions
+4 -7
View File
@@ -1,4 +1,4 @@
const { Command } = require('discord.js-commando');
const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js');
const { stripIndents } = require('common-tags');
@@ -11,6 +11,7 @@ module.exports = class HelpCommand extends Command {
memberName: 'help',
description: 'Displays a list of available commands, or detailed information for a specified command.',
guarded: true,
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'command',
@@ -36,15 +37,11 @@ module.exports = class HelpCommand extends Command {
**Group:** ${commands[0].group.name}
${commands[0].details || ''}
`);
} else if (commands.length > 1) {
return msg.say(`Multiple Commands Found. Please be more specific: ${commands.map(c => c.name).join(', ')}`);
} 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.`)
.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,
+3 -5
View File
@@ -1,4 +1,4 @@
const { Command } = require('discord.js-commando');
const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js');
const { oneLine } = require('common-tags');
const { version } = require('../../package');
@@ -13,14 +13,12 @@ module.exports = class InfoCommand extends Command {
group: 'util',
memberName: 'info',
description: 'Gives some bot info.',
guarded: true
guarded: true,
clientPermissions: ['EMBED_LINKS']
});
}
async run(msg) {
if (msg.channel.type !== 'dm')
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const guilds = await this.client.shard.fetchClientValues('guilds.size');
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
const embed = new RichEmbed()
+1 -1
View File
@@ -1,4 +1,4 @@
const { Command } = require('discord.js-commando');
const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags');
module.exports = class InviteCommand extends Command {
+3 -4
View File
@@ -1,4 +1,4 @@
const { Command } = require('discord.js-commando');
const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags');
module.exports = class PingCommand extends Command {
@@ -16,9 +16,8 @@ module.exports = class PingCommand extends Command {
async run(msg) {
const message = await msg.say('Pinging...');
return message.edit(stripIndents`
:ping_pong: Pong!
**Message Ping:** ${Math.round(message.createdTimestamp - msg.createdTimestamp)}ms
**Heartbeat Ping:** ${Math.round(this.client.ping)}ms
:ping_pong: Pong! \`${Math.round(message.createdTimestamp - msg.createdTimestamp)}ms\`
Heartbeat: \`${Math.round(this.client.ping)}ms\`
`);
}
};
+2 -4
View File
@@ -1,4 +1,4 @@
const { Command } = require('discord.js-commando');
const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js');
const moment = require('moment');
require('moment-duration-format');
@@ -12,6 +12,7 @@ module.exports = class ShardInfoCommand extends Command {
memberName: 'shard-info',
description: 'Gives some bot info for the Shard you specify.',
guarded: true,
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'shard',
@@ -27,9 +28,6 @@ module.exports = class ShardInfoCommand extends Command {
}
async run(msg, args) {
if (msg.channel.type !== 'dm')
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { shard } = args;
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
const uptime = await this.client.shard.fetchClientValues('uptime');
+1 -1
View File
@@ -1,4 +1,4 @@
const { Command } = require('discord.js-commando');
const Command = require('../../structures/Command');
const moment = require('moment');
require('moment-duration-format');