From f4a5b409c38e0c08c86362fdabc65cb1b476c780 Mon Sep 17 00:00:00 2001 From: Ske Date: Thu, 31 Oct 2019 16:36:33 +0100 Subject: [PATCH] Fix message querying for real this time --- PluralKit.Bot/Services/EmbedService.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/PluralKit.Bot/Services/EmbedService.cs b/PluralKit.Bot/Services/EmbedService.cs index d9c9694a..2e8ebb83 100644 --- a/PluralKit.Bot/Services/EmbedService.cs +++ b/PluralKit.Bot/Services/EmbedService.cs @@ -167,11 +167,12 @@ namespace PluralKit.Bot { var guildUser = await shard.Rest.GetGuildUserAsync(channel.Guild.Id, msg.Message.Sender); if (guildUser != null) { - roles = guildUser.RoleIds - .Select(roleId => channel.Guild.GetRole(roleId)) - .Where(role => role.Name != "@everyone") - .OrderByDescending(role => role.Position) - .ToList(); + if (guildUser.RoleIds.Count > 0) + roles = guildUser.RoleIds + .Select(roleId => channel.Guild.GetRole(roleId)) + .Where(role => role.Name != "@everyone") + .OrderByDescending(role => role.Position) + .ToList(); userStr = guildUser.Nickname != null ? $"**Username:** {guildUser?.NameAndMention()}\n**Nickname:** {guildUser.Nickname}" : guildUser?.NameAndMention(); }