From 9c8b81049b9f81385b603f60c2b9a424a9bd1e26 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 15 Apr 2020 04:43:38 +0200 Subject: [PATCH 1/5] fix color --- commands/utility/userInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/utility/userInfo.js b/commands/utility/userInfo.js index 69fc7576..06b58f06 100644 --- a/commands/utility/userInfo.js +++ b/commands/utility/userInfo.js @@ -31,7 +31,7 @@ class userInfoCommand extends Command { let member = message.guild.member(user); const Embed = this.client.util.embed() - .setColor(member.displayHexColor) + .setColor(message.member ? message.member.displayHexColor : 'NAVY') .setAuthor(`${user.tag} (${user.id})`, user.displayAvatarURL()) .addField('Current rank hex color', member.displayHexColor, true) .addField('Joined guild at', member.joinedAt, true) From 63083caa495e006fab177f22f7212dd117024595 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 15 Apr 2020 04:45:05 +0200 Subject: [PATCH 2/5] Actually fix the color --- commands/utility/userInfo.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commands/utility/userInfo.js b/commands/utility/userInfo.js index 06b58f06..5c4ce834 100644 --- a/commands/utility/userInfo.js +++ b/commands/utility/userInfo.js @@ -29,9 +29,8 @@ class userInfoCommand extends Command { } let member = message.guild.member(user); - const Embed = this.client.util.embed() - .setColor(message.member ? message.member.displayHexColor : 'NAVY') + .setColor(member ? member.displayHexColor : 'NAVY') .setAuthor(`${user.tag} (${user.id})`, user.displayAvatarURL()) .addField('Current rank hex color', member.displayHexColor, true) .addField('Joined guild at', member.joinedAt, true) From 24a994308c47bb2dc523ed6c39cd40aacb4d3536 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 15 Apr 2020 04:47:50 +0200 Subject: [PATCH 3/5] no rank color --- commands/utility/userInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/utility/userInfo.js b/commands/utility/userInfo.js index 5c4ce834..82e04526 100644 --- a/commands/utility/userInfo.js +++ b/commands/utility/userInfo.js @@ -32,7 +32,7 @@ class userInfoCommand extends Command { const Embed = this.client.util.embed() .setColor(member ? member.displayHexColor : 'NAVY') .setAuthor(`${user.tag} (${user.id})`, user.displayAvatarURL()) - .addField('Current rank hex color', member.displayHexColor, true) + .addField('Current rank hex color', member ? member.displayHexColor : 'No rank color', true) .addField('Joined guild at', member.joinedAt, true) .addField('Date when account created', user.createdAt, true) .setTimestamp(); From cacdf712425bf18bd916764b053f9b576f734309 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 15 Apr 2020 04:48:41 +0200 Subject: [PATCH 4/5] fix joined at when not in guild --- commands/utility/userInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/utility/userInfo.js b/commands/utility/userInfo.js index 82e04526..e79a7996 100644 --- a/commands/utility/userInfo.js +++ b/commands/utility/userInfo.js @@ -33,7 +33,7 @@ class userInfoCommand extends Command { .setColor(member ? member.displayHexColor : 'NAVY') .setAuthor(`${user.tag} (${user.id})`, user.displayAvatarURL()) .addField('Current rank hex color', member ? member.displayHexColor : 'No rank color', true) - .addField('Joined guild at', member.joinedAt, true) + .addField('Joined guild at', member ? member.joinedAt : 'Not in this guild', true) .addField('Date when account created', user.createdAt, true) .setTimestamp(); From 0f89f5af28a27976efe526bba90dbc85a2a34dd4 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 15 Apr 2020 04:49:58 +0200 Subject: [PATCH 5/5] Moved thing that needed member in if --- commands/utility/userInfo.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/commands/utility/userInfo.js b/commands/utility/userInfo.js index e79a7996..75278bc2 100644 --- a/commands/utility/userInfo.js +++ b/commands/utility/userInfo.js @@ -38,8 +38,14 @@ class userInfoCommand extends Command { .setTimestamp(); - // Show since when this user have been boosting the current guild - if (member.premiumSince) Embed.addField('Boosting this guild since', member.premiumSince, true); + + if (member) { + // Show since when this user have been boosting the current guild + if (member.premiumSince) Embed.addField('Boosting this guild since', member.premiumSince, true); + // Show guild nickname + if (member.nickname) Embed.addField('Nickname', member.nickname, true); + + } Embed.addField('​', '​'); @@ -52,8 +58,6 @@ class userInfoCommand extends Command { // Is the user a bot? if (user.bot) Embed.addField('Is a bot?', '✅', true); - // Show guild nickname - if (member.nickname) Embed.addField('Nickname', member.nickname, true); // Show user locale ( i have no idea what it is ) https://discord.js.org/#/docs/main/master/class/User?scrollTo=locale if (user.locale) Embed.addField('Locale settings', user.locale, true);