fix(bot): make deletion ID checks accept hyphens/caps

This commit is contained in:
Iris System 2024-05-01 21:13:12 +12:00
parent eccab602d5
commit 7965e15282
4 changed files with 20 additions and 15 deletions

View file

@ -574,10 +574,10 @@ public class Groups
ctx.CheckOwnGroup(target);
await ctx.Reply(
$"{Emojis.Warn} Are you sure you want to delete this group? If so, reply to this message with the group's ID (`{target.Hid}`).\n**Note: this action is permanent.**");
if (!await ctx.ConfirmWithReply(target.Hid))
$"{Emojis.Warn} Are you sure you want to delete this group? If so, reply to this message with the group's ID (`{target.DisplayHid(ctx.Config)}`).\n**Note: this action is permanent.**");
if (!await ctx.ConfirmWithReply(target.Hid, treatAsHid: true))
throw new PKError(
$"Group deletion cancelled. Note that you must reply with your group ID (`{target.Hid}`) *verbatim*.");
$"Group deletion cancelled. Note that you must reply with your group ID (`{target.DisplayHid(ctx.Config)}`) *verbatim*.");
await ctx.Repository.DeleteGroup(target.Id);