Confirm before clearing (most) entity properties

This commit is contained in:
dev-kittens
2020-10-04 08:53:07 +00:00
parent 969065724d
commit dfacbc51ab
7 changed files with 32 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -86,7 +86,7 @@ namespace PluralKit.Bot
public async Task GroupDisplayName(Context ctx, PKGroup target)
{
if (ctx.MatchClear())
if (await ctx.MatchClear("this group's display name"))
{
ctx.CheckOwnGroup(target);
@@ -122,7 +122,7 @@ namespace PluralKit.Bot
public async Task GroupDescription(Context ctx, PKGroup target)
{
if (ctx.MatchClear())
if (await ctx.MatchClear("this group's description"))
{
ctx.CheckOwnGroup(target);
@@ -216,7 +216,7 @@ namespace PluralKit.Bot
throw new PKSyntaxError("This group does not have an icon set. Set one by attaching an image to this command, or by passing an image URL or @mention.");
}
if (ctx.MatchClear())
if (await ctx.MatchClear("this group's icon"))
await ClearIcon();
else if (await ctx.MatchImage() is {} img)
await SetIcon(img);