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
+4 -4
View File
@@ -11,20 +11,20 @@ module.exports = class AvatarCommand extends commando.Command {
});
}
async run(message) {
run(message) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
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 {
if (!message.mentions.users.first().avatarURL) {
message.channel.send(":x: Error! This person has no avatar!");
return message.channel.send(":x: Error! This person has no avatar!");
}
else {
message.channel.send(message.mentions.users.first().avatarURL);
return message.channel.send(message.mentions.users.first().avatarURL);
}
}
}
+5 -5
View File
@@ -17,7 +17,7 @@ module.exports = class UserInfoCommand extends commando.Command {
});
}
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;
}
@@ -54,7 +54,7 @@ module.exports = class UserInfoCommand extends commando.Command {
break;
}
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 {
if (!message.mentions.users.first().presence.game) {
@@ -73,7 +73,7 @@ module.exports = class UserInfoCommand extends commando.Command {
stat, true)
.addField('**Playing:**',
"None", true);
message.channel.sendEmbed(embed).catch(console.error);
return message.channel.sendEmbed(embed);
}
else {
const embed = new Discord.RichEmbed()
@@ -91,12 +91,12 @@ module.exports = class UserInfoCommand extends commando.Command {
stat, true)
.addField('**Playing:**',
message.mentions.users.first().presence.game.name, true);
message.channel.sendEmbed(embed).catch(console.error);
return message.channel.sendEmbed(embed);
}
}
}
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!");
}
}
};