mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
Also send gifs over to avatar service
This commit is contained in:
parent
7d01c02de0
commit
7880d3baf9
1 changed files with 2 additions and 2 deletions
|
|
@ -63,7 +63,7 @@ public static class AvatarUtils
|
||||||
// This lets us add resizing parameters to "borrow" their media proxy server to downsize the image
|
// 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!
|
// which in turn makes it more likely to be underneath the size limit!
|
||||||
private static readonly Regex DiscordCdnUrl =
|
private static readonly Regex DiscordCdnUrl =
|
||||||
new(@"^https?://(?:cdn\.discordapp\.com|media\.discordapp\.net)/attachments/(\d{17,19})/(\d{17,19})/([^/\\&\?]+)\.(png|jpe?g|webp)(?:\?(?<query>.*))?$", RegexOptions.IgnoreCase);
|
new(@"^https?://(?:cdn\.discordapp\.com|media\.discordapp\.net)/attachments/(\d{17,19})/(\d{17,19})/([^/\\&\?]+)\.(png|jpe?g|gif|webp)(?:\?(?<query>.*))?$", RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
private static readonly string DiscordMediaUrlReplacement =
|
private static readonly string DiscordMediaUrlReplacement =
|
||||||
"https://media.discordapp.net/attachments/$1/$2/$3.$4?width=256&height=256";
|
"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;
|
public static bool IsDiscordCdnUrl(string? url) => url != null && DiscordCdnUrl.Match(url).Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue