Skip to content

Commit

Permalink
Add confirmation prompt when unlinking. Closes #38.
Browse files Browse the repository at this point in the history
  • Loading branch information
xSke committed Jan 17, 2019
1 parent 47a81d4 commit 3c96852
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pluralkit/bot/commands/system_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ async def account_link(ctx: CommandContext):

async def account_unlink(ctx: CommandContext):
system = await ctx.ensure_system()

msg = await ctx.reply("Are you sure you want to unlink this account from your system?")
if not await ctx.confirm_react(ctx.message.author, msg):
raise CommandError("Account unlink cancelled.")

try:
await system.unlink_account(ctx.conn, ctx.message.author.id)
Expand Down

0 comments on commit 3c96852

Please sign in to comment.