mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(bot): check own system before confirming clear in a few commands
This commit is contained in:
parent
614131265b
commit
620364bf61
2 changed files with 6 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue