Merge pull request #822 from fkndean/patch-3

Fix null AvatarUrl issue
This commit is contained in:
Master Kwoth 2016-11-30 14:00:49 +01:00 committed by GitHub
commit 22ec21e34e

View File

@ -95,8 +95,9 @@ __`Users:`__ **{(await ch.GetUsersAsync()).Count()}**";
🎮 __`Current Game:`__ **{(user.Game?.Name == null ? "-" : user.Game.Name)}**
📅 __`Joined Server:`__ **{user.JoinedAt?.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()}**
📷 __`Avatar URL:`__ **{await NadekoBot.Google.ShortenUrl(user.AvatarUrl).ConfigureAwait(false)}**";
__`Roles:`__ **({user.Roles.Count()}) - {string.Join(", ", user.Roles.Select(r => r.Name)).SanitizeMentions()}**";
if (!string.IsNullOrWhiteSpace(user.AvatarUrl))
toReturn += $@"📷 __`Avatar URL:`__ **{await NadekoBot.Google.ShortenUrl(user.AvatarUrl).ConfigureAwait(false)}**";
await msg.Reply(toReturn).ConfigureAwait(false);
}
}