From 9050291e858814de6047f47a41e1c97e4c54b683 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Thu, 19 Oct 2017 09:04:53 +0200 Subject: [PATCH] .log userupdated will properly log gif avatar changes now --- .../Modules/Administration/Services/LogCommandService.cs | 8 ++++---- NadekoBot.Core/_Extensions/IUserExtensions.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NadekoBot.Core/Modules/Administration/Services/LogCommandService.cs b/NadekoBot.Core/Modules/Administration/Services/LogCommandService.cs index 17ba8293..f1d6c2ad 100644 --- a/NadekoBot.Core/Modules/Administration/Services/LogCommandService.cs +++ b/NadekoBot.Core/Modules/Administration/Services/LogCommandService.cs @@ -154,10 +154,10 @@ namespace NadekoBot.Modules.Administration.Services .WithFooter(fb => fb.WithText(CurrentTime(g))) .WithOkColor(); - if (Uri.IsWellFormedUriString(before.GetAvatarUrl(), UriKind.Absolute)) - embed.WithThumbnailUrl(before.GetAvatarUrl()); - if (Uri.IsWellFormedUriString(after.GetAvatarUrl(), UriKind.Absolute)) - embed.WithImageUrl(after.GetAvatarUrl()); + if (Uri.IsWellFormedUriString(before.RealAvatarUrl(), UriKind.Absolute)) + embed.WithThumbnailUrl(before.RealAvatarUrl()); + if (Uri.IsWellFormedUriString(after.RealAvatarUrl(), UriKind.Absolute)) + embed.WithImageUrl(after.RealAvatarUrl()); } else { diff --git a/NadekoBot.Core/_Extensions/IUserExtensions.cs b/NadekoBot.Core/_Extensions/IUserExtensions.cs index d00d9cb3..36a7f9e5 100644 --- a/NadekoBot.Core/_Extensions/IUserExtensions.cs +++ b/NadekoBot.Core/_Extensions/IUserExtensions.cs @@ -44,6 +44,6 @@ namespace NadekoBot.Extensions public static string RealAvatarUrl(this DiscordUser usr) => usr.AvatarId.StartsWith("a_") ? $"{DiscordConfig.CDNUrl}avatars/{usr.UserId}/{usr.AvatarId}.gif" - : $"{DiscordConfig.CDNUrl}avatars/{usr.UserId}/{usr.AvatarId}.png"; + : ((IUser)usr).GetAvatarUrl(ImageFormat.Auto); } }