return and await

This commit is contained in:
Daniel Odendahl Jr
2017-03-23 13:16:59 +00:00
parent cea110ce4b
commit 7c0a39ec5c
83 changed files with 295 additions and 264 deletions
+3 -3
View File
@@ -17,14 +17,14 @@ module.exports = class AvatarCommand extends commando.Command {
}
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);
}
}
}
+4 -4
View File
@@ -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).catch(console.error);
}
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).catch(console.error);
}
}
}
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!");
}
}
};