Fix null AvatarUrl issue

This commit is contained in:
Kevin 2016-11-30 07:59:48 -05:00 committed by GitHub
parent c4eab4bd6d
commit d43d5a1726

View File

@ -91,13 +91,14 @@ __`Users:`__ **{(await ch.GetUsersAsync()).Count()}**";
var toReturn = $"👤 __`Name:`__ **{user.Username}#{user.Discriminator}**\n"; var toReturn = $"👤 __`Name:`__ **{user.Username}#{user.Discriminator}**\n";
if (!string.IsNullOrWhiteSpace(user.Nickname)) if (!string.IsNullOrWhiteSpace(user.Nickname))
toReturn += $"🆕 __`Nickname:`__ **{user.Nickname}** "; toReturn += $"🆕 __`Nickname:`__ **{user.Nickname}** ";
toReturn += $@"🏷 __`ID:`__ **{user.Id}** toReturn += $@"🏷 __`ID:`__ **{user.Id}**
🎮 __`Current Game:`__ **{(user.Game?.Name == null ? "-" : user.Game.Name)}** 🎮 __`Current Game:`__ **{(user.Game?.Name == null ? "-" : user.Game.Name)}**
📅 __`Joined Server:`__ **{user.JoinedAt?.ToString("dd.MM.yyyy HH:mm")}** 📅 __`Joined Server:`__ **{user.JoinedAt?.ToString("dd.MM.yyyy HH:mm")}**
🗓 __`Joined Discord:`__ **{user.CreatedAt.ToString("dd.MM.yyyy HH:mm")}** 🗓 __`Joined Discord:`__ **{user.CreatedAt.ToString("dd.MM.yyyy HH:mm")}**
__`Roles:`__ **({user.Roles.Count()}) - {string.Join(", ", user.Roles.Select(r => r.Name)).SanitizeMentions()}** __`Roles:`__ **({user.Roles.Count()}) - {string.Join(", ", user.Roles.Select(r => r.Name)).SanitizeMentions()}**";
📷 __`Avatar URL:`__ **{await NadekoBot.Google.ShortenUrl(user.AvatarUrl).ConfigureAwait(false)}**"; if (!string.IsNullOrWhiteSpace(user.AvatarUrl))
await msg.Reply(toReturn).ConfigureAwait(false); toReturn += $@"📷 __`Avatar URL:`__ **{await NadekoBot.Google.ShortenUrl(user.AvatarUrl).ConfigureAwait(false)}**";
await msg.Reply(toReturn).ConfigureAwait(false);
} }
} }
} }