From 946bacf79e122e716763b869f475e02feb20a045 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 3 Apr 2017 22:37:13 +0000 Subject: [PATCH] Fix --- commands/userinfo/userinfo.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/commands/userinfo/userinfo.js b/commands/userinfo/userinfo.js index 050eb4a3..e0c9e844 100644 --- a/commands/userinfo/userinfo.js +++ b/commands/userinfo/userinfo.js @@ -51,6 +51,13 @@ 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 embed = new Discord.RichEmbed() .setColor(color) .setThumbnail(user.displayAvatarURL) @@ -65,7 +72,7 @@ module.exports = class UserInfoCommand extends commando.Command { .addField('**Status:**', stat, true) .addField('**Playing:**', - user.presence.game.name || 'None', true); + userGame, true); return message.embed(embed); } };