mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-15 18:20:11 +00:00
fix(bot): remove query params from avatar attachment on member creation
see also commit 8cf50a7d97
This commit is contained in:
parent
f99e10ae08
commit
1aa410e4f4
1 changed files with 6 additions and 2 deletions
|
|
@ -70,8 +70,12 @@ public class Member
|
||||||
if (avatarArg != null)
|
if (avatarArg != null)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await AvatarUtils.VerifyAvatarOrThrow(_client, avatarArg.Url);
|
// XXX: strip query params from attachment URLs because of new Discord CDN shenanigans
|
||||||
await ctx.Repository.UpdateMember(member.Id, new MemberPatch { AvatarUrl = avatarArg.Url }, conn);
|
var uriBuilder = new UriBuilder(avatarArg.Url);
|
||||||
|
uriBuilder.Query = "";
|
||||||
|
|
||||||
|
await AvatarUtils.VerifyAvatarOrThrow(_client, uriBuilder.Uri.AbsoluteUri);
|
||||||
|
await ctx.Repository.UpdateMember(member.Id, new MemberPatch { AvatarUrl = uriBuilder.Uri.AbsoluteUri }, conn);
|
||||||
|
|
||||||
dispatchData.Add("avatar_url", avatarArg.Url);
|
dispatchData.Add("avatar_url", avatarArg.Url);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue