fix(bot): remove query params from avatar attachment on member creation

see also commit 8cf50a7d97
This commit is contained in:
Iris System 2023-10-11 15:17:09 +13:00
parent f99e10ae08
commit 1aa410e4f4

View file

@ -70,8 +70,12 @@ public class Member
if (avatarArg != null)
try
{
await AvatarUtils.VerifyAvatarOrThrow(_client, avatarArg.Url);
await ctx.Repository.UpdateMember(member.Id, new MemberPatch { AvatarUrl = avatarArg.Url }, conn);
// XXX: strip query params from attachment URLs because of new Discord CDN shenanigans
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);
}