mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-09 23:37:54 +00:00
Confirm before clearing (most) entity properties
This commit is contained in:
parent
969065724d
commit
dfacbc51ab
7 changed files with 32 additions and 21 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue