Remove all useless async

This commit is contained in:
Daniel Odendahl Jr
2017-03-24 12:16:58 +00:00
parent 33b7d18d54
commit 0ce7eb3ee1
95 changed files with 287 additions and 287 deletions
+5 -5
View File
@@ -16,7 +16,7 @@ module.exports = class WarnCommand extends commando.Command {
return msg.member.hasPermission('MANAGE_MESSAGES');
}
async run(message) {
run(message) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
@@ -25,7 +25,7 @@ module.exports = class WarnCommand extends commando.Command {
let userToWarn = message.mentions.users.first();
let reason = message.content.split(" ").slice(2).join(" ");
if (message.mentions.users.size !== 1) {
message.channel.send(":x: Error! Please mention one user!");
return message.channel.send(":x: Error! Please mention one user!");
}
else {
message.channel.send(":ok_hand:");
@@ -36,15 +36,15 @@ module.exports = class WarnCommand extends commando.Command {
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp()
.setDescription(`**Member:** ${userToWarn.username}#${userToWarn.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`);
message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
}
else {
message.channel.send("**Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
return message.channel.send("**Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
}
}
}
else {
message.channel.send(":x: Error! This command does not work in DM!");
return message.channel.send(":x: Error! This command does not work in DM!");
}
}
};