The Power of const

This commit is contained in:
Daniel Odendahl Jr
2017-04-03 22:31:19 +00:00
parent 4f0f1b4ad2
commit 76907549df
87 changed files with 525 additions and 558 deletions
+3 -9
View File
@@ -30,7 +30,7 @@ module.exports = class UserInfoCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let user = args.user;
const user = args.user;
let stat;
let color;
switch (user.presence.status) {
@@ -51,13 +51,7 @@ module.exports = class UserInfoCommand extends commando.Command {
color = 0x808080;
break;
}
let userGame;
if (!user.presence.game) {
userGame = "None";
}
else {
userGame = user.presence.game.name;
}
const userGame = user.presence.game;
const embed = new Discord.RichEmbed()
.setColor(color)
.setThumbnail(user.displayAvatarURL)
@@ -72,7 +66,7 @@ module.exports = class UserInfoCommand extends commando.Command {
.addField('**Status:**',
stat, true)
.addField('**Playing:**',
userGame, true);
userGame.name || 'None', true);
return message.embed(embed);
}
};