mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix: inconsistent behavior with non-owned banner lookups
This commit is contained in:
parent
ceeac24296
commit
562afcdb8a
1 changed files with 5 additions and 3 deletions
|
|
@ -194,16 +194,18 @@ public class MemberEdit
|
|||
|
||||
public async Task BannerImage(Context ctx, PKMember target)
|
||||
{
|
||||
ctx.CheckOwnMember(target);
|
||||
|
||||
async Task ClearBannerImage()
|
||||
{
|
||||
ctx.CheckOwnMember(target);
|
||||
await ctx.ConfirmClear("this member's banner image");
|
||||
|
||||
await ctx.Repository.UpdateMember(target.Id, new MemberPatch { BannerImage = null });
|
||||
await ctx.Reply($"{Emojis.Success} Member banner image cleared.");
|
||||
}
|
||||
|
||||
async Task SetBannerImage(ParsedImage img)
|
||||
{
|
||||
ctx.CheckOwnMember(target);
|
||||
img = await _avatarHosting.TryRehostImage(img, AvatarHostingService.RehostedImageType.Banner, ctx.Author.Id, ctx.System);
|
||||
await AvatarUtils.VerifyAvatarOrThrow(_client, img.Url, true);
|
||||
|
||||
|
|
@ -253,7 +255,7 @@ public class MemberEdit
|
|||
"This member does not have a banner image set." + ((target.System == ctx.System?.Id) ? " Set one by attaching an image to this command, or by passing an image URL." : ""));
|
||||
}
|
||||
|
||||
if (ctx.MatchClear() && await ctx.ConfirmClear("this member's banner image"))
|
||||
if (ctx.MatchClear())
|
||||
await ClearBannerImage();
|
||||
else if (await ctx.MatchImage() is { } img)
|
||||
await SetBannerImage(img);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue