mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 14:27: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
|
|
@ -17,6 +17,12 @@ using PluralKit.Core;
|
|||
|
||||
namespace PluralKit.Bot {
|
||||
public static class ContextUtils {
|
||||
public static async Task<bool> ConfirmClear(this Context ctx, string toClear)
|
||||
{
|
||||
if (!(await ctx.PromptYesNo($"{Emojis.Warn} Are you sure you want to clear {toClear}?"))) throw Errors.GenericCancelled();
|
||||
else return true;
|
||||
}
|
||||
|
||||
public static async Task<bool> PromptYesNo(this Context ctx, String msgString, DiscordUser user = null, Duration? timeout = null, IEnumerable<IMention> mentions = null)
|
||||
{
|
||||
DiscordMessage message;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue