Fix message querying for real this time

This commit is contained in:
Ske 2019-10-31 16:36:33 +01:00
parent 1a79d52bfb
commit f4a5b409c3

View File

@ -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();
}