From 7880d3baf9ea33d3bf9ce8059f417b0ecb78d0de Mon Sep 17 00:00:00 2001 From: Astrid Date: Thu, 22 Feb 2024 06:38:15 +0100 Subject: [PATCH] Also send gifs over to avatar service --- PluralKit.Bot/Utils/AvatarUtils.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PluralKit.Bot/Utils/AvatarUtils.cs b/PluralKit.Bot/Utils/AvatarUtils.cs index 0f6d314c..c7caaf94 100644 --- a/PluralKit.Bot/Utils/AvatarUtils.cs +++ b/PluralKit.Bot/Utils/AvatarUtils.cs @@ -63,7 +63,7 @@ public static class AvatarUtils // This lets us add resizing parameters to "borrow" their media proxy server to downsize the image // which in turn makes it more likely to be underneath the size limit! private static readonly Regex DiscordCdnUrl = - new(@"^https?://(?:cdn\.discordapp\.com|media\.discordapp\.net)/attachments/(\d{17,19})/(\d{17,19})/([^/\\&\?]+)\.(png|jpe?g|webp)(?:\?(?.*))?$", RegexOptions.IgnoreCase); + new(@"^https?://(?:cdn\.discordapp\.com|media\.discordapp\.net)/attachments/(\d{17,19})/(\d{17,19})/([^/\\&\?]+)\.(png|jpe?g|gif|webp)(?:\?(?.*))?$", RegexOptions.IgnoreCase); private static readonly string DiscordMediaUrlReplacement = "https://media.discordapp.net/attachments/$1/$2/$3.$4?width=256&height=256"; @@ -82,4 +82,4 @@ public static class AvatarUtils } public static bool IsDiscordCdnUrl(string? url) => url != null && DiscordCdnUrl.Match(url).Success; -} \ No newline at end of file +}