mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
add missing confirms to command handlers and -yes flags to the definitions
This commit is contained in:
parent
12655fb539
commit
498d657cd4
3 changed files with 19 additions and 6 deletions
|
|
@ -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.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue