mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 08:10:10 +00:00
feat(bot): use avater service for image verify
This commit is contained in:
parent
5f6c8c0d14
commit
d537f05b23
9 changed files with 94 additions and 63 deletions
|
|
@ -291,7 +291,7 @@ public class Groups
|
|||
ctx.CheckOwnGroup(target);
|
||||
|
||||
img = await _avatarHosting.TryRehostImage(img, AvatarHostingService.RehostedImageType.Avatar, ctx.Author.Id, ctx.System);
|
||||
await AvatarUtils.VerifyAvatarOrThrow(_client, img.Url);
|
||||
await _avatarHosting.VerifyAvatarOrThrow(img.Url);
|
||||
|
||||
await ctx.Repository.UpdateGroup(target.Id, new GroupPatch { Icon = img.CleanUrl ?? img.Url });
|
||||
|
||||
|
|
@ -366,7 +366,7 @@ public class Groups
|
|||
ctx.CheckOwnGroup(target);
|
||||
|
||||
img = await _avatarHosting.TryRehostImage(img, AvatarHostingService.RehostedImageType.Banner, ctx.Author.Id, ctx.System);
|
||||
await AvatarUtils.VerifyAvatarOrThrow(_client, img.Url, true);
|
||||
await _avatarHosting.VerifyAvatarOrThrow(img.Url, true);
|
||||
|
||||
await ctx.Repository.UpdateGroup(target.Id, new GroupPatch { BannerImage = img.CleanUrl ?? img.Url });
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue