Make Code Prettier

This commit is contained in:
Daniel Odendahl Jr
2017-05-04 02:40:56 +00:00
parent e5f93b63cb
commit cf87f126d6
71 changed files with 354 additions and 343 deletions
+9 -11
View File
@@ -21,7 +21,7 @@ module.exports = class KickCommand extends Command {
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140) {
if(reason.length < 140) {
return true;
}
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
@@ -36,15 +36,15 @@ module.exports = class KickCommand extends Command {
}
async run(msg, args) {
if (!msg.channel.permissionsFor(this.client.user).has('KICK_MEMBERS'))
if(!msg.channel.permissionsFor(this.client.user).has('KICK_MEMBERS'))
return msg.say('This Command requires the `Kick Members` Permission.');
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
if (!modlogs)
if(!modlogs)
return msg.say('This Command requires a channel set with the `modchannel` command.');
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { member, reason } = args;
if (!member.kickable)
if(!member.kickable)
return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
try {
try {
@@ -52,12 +52,10 @@ module.exports = class KickCommand extends Command {
You were kicked from ${msg.guild.name}!
Reason: ${reason}.
`);
} catch (err) {
} catch(err) {
await msg.say('Failed to send DM.');
}
await member.kick({
reason
});
await member.kick({ reason });
await msg.say(':ok_hand:');
const embed = new RichEmbed()
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
@@ -68,8 +66,8 @@ module.exports = class KickCommand extends Command {
**Action:** Kick
**Reason:** ${reason}
`);
return modlogs.send({embed});
} catch (err) {
return modlogs.send({ embed });
} catch(err) {
return msg.say('An Unknown Error Occurred.');
}
}