From 620364bf61cb2090bec600349f6120d7e9a83fb1 Mon Sep 17 00:00:00 2001 From: alyssa Date: Sun, 10 Nov 2024 11:03:18 +0900 Subject: [PATCH] fix(bot): check own system before confirming clear in a few commands --- PluralKit.Bot/Commands/Groups.cs | 6 ++++-- PluralKit.Bot/Commands/MemberAvatar.cs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PluralKit.Bot/Commands/Groups.cs b/PluralKit.Bot/Commands/Groups.cs index e442401e..a6105275 100644 --- a/PluralKit.Bot/Commands/Groups.cs +++ b/PluralKit.Bot/Commands/Groups.cs @@ -273,6 +273,7 @@ public class Groups { async Task ClearIcon() { + await ctx.ConfirmClear("this group's icon"); ctx.CheckOwnGroup(target); await ctx.Repository.UpdateGroup(target.Id, new GroupPatch { Icon = null }); @@ -328,7 +329,7 @@ public class Groups } } - if (ctx.MatchClear() && await ctx.ConfirmClear("this group's icon")) + if (ctx.MatchClear()) await ClearIcon(); else if (await ctx.MatchImage() is { } img) await SetIcon(img); @@ -340,6 +341,7 @@ public class Groups { async Task ClearBannerImage() { + await ctx.ConfirmClear("this group's banner image"); ctx.CheckOwnGroup(target); await ctx.Repository.UpdateGroup(target.Id, new GroupPatch { BannerImage = null }); @@ -394,7 +396,7 @@ public class Groups } } - if (ctx.MatchClear() && await ctx.ConfirmClear("this group's banner image")) + if (ctx.MatchClear()) await ClearBannerImage(); else if (await ctx.MatchImage() is { } img) await SetBannerImage(img); diff --git a/PluralKit.Bot/Commands/MemberAvatar.cs b/PluralKit.Bot/Commands/MemberAvatar.cs index e626944e..66c17de1 100644 --- a/PluralKit.Bot/Commands/MemberAvatar.cs +++ b/PluralKit.Bot/Commands/MemberAvatar.cs @@ -123,9 +123,10 @@ public class MemberAvatar MemberGuildSettings? guildData) { // First, see if we need to *clear* - if (ctx.MatchClear() && await ctx.ConfirmClear("this member's " + location.Name())) + if (ctx.MatchClear()) { ctx.CheckSystem().CheckOwnMember(target); + await ctx.ConfirmClear("this member's " + location.Name()); await AvatarClear(location, ctx, target, guildData); return; }