add missing confirms to command handlers and -yes flags to the definitions

This commit is contained in:
dawn 2026-01-26 02:38:53 +03:00
parent 12655fb539
commit 498d657cd4
No known key found for this signature in database
3 changed files with 19 additions and 6 deletions

View file

@ -174,10 +174,13 @@ public class Groups
await ctx.Reply(embed: eb2.Build());
}
public async Task ClearGroupDisplayName(Context ctx, PKGroup target)
public async Task ClearGroupDisplayName(Context ctx, PKGroup target, bool confirmYes = false)
{
ctx.CheckOwnGroup(target);
if (!await ctx.ConfirmClear("this group's display name", confirmYes))
return;
var patch = new GroupPatch { DisplayName = Partial<string>.Null() };
await ctx.Repository.UpdateGroup(target.Id, patch);
@ -253,10 +256,13 @@ public class Groups
await ctx.Reply(embed: eb2.Build());
}
public async Task ClearGroupDescription(Context ctx, PKGroup target)
public async Task ClearGroupDescription(Context ctx, PKGroup target, bool confirmYes = false)
{
ctx.CheckOwnGroup(target);
if (!await ctx.ConfirmClear("this group's description", confirmYes))
return;
var patch = new GroupPatch { Description = Partial<string>.Null() };
await ctx.Repository.UpdateGroup(target.Id, patch);
@ -479,10 +485,13 @@ public class Groups
await ctx.Reply(embed: eb.Build(), files: [MiscUtils.GenerateColorPreview(target.Color)]);
}
public async Task ClearGroupColor(Context ctx, PKGroup target)
public async Task ClearGroupColor(Context ctx, PKGroup target, bool confirmYes = false)
{
ctx.CheckOwnGroup(target);
if (!await ctx.ConfirmClear("this group's color", confirmYes))
return;
await ctx.Repository.UpdateGroup(target.Id, new GroupPatch { Color = Partial<string>.Null() });
await ctx.Reply($"{Emojis.Success} Group color cleared.");