mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +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)
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue