From 4fcf32b5e99e000b7054df212c718221374f3d49 Mon Sep 17 00:00:00 2001 From: palmtree5 <3577255+palmtree5@users.noreply.github.com> Date: Mon, 12 Mar 2018 15:05:21 -0800 Subject: [PATCH] [V3 Bank] Add confirmation prompt on [p]bankset toggleglobal (#1402) --- redbot/cogs/bank/bank.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/redbot/cogs/bank/bank.py b/redbot/cogs/bank/bank.py index 50f9c35bf..b51f1c9ba 100644 --- a/redbot/cogs/bank/bank.py +++ b/redbot/cogs/bank/bank.py @@ -58,16 +58,23 @@ class Bank: @bankset.command(name="toggleglobal") @checks.is_owner() - async def bankset_toggleglobal(self, ctx: commands.Context): + async def bankset_toggleglobal(self, ctx: commands.Context, confirm: bool=False): """Toggles whether the bank is global or not If the bank is global, it will become per-guild If the bank is per-guild, it will become global""" cur_setting = await bank.is_global() - await bank.set_global(not cur_setting) word = _("per-guild") if cur_setting else _("global") - - await ctx.send(_("The bank is now {}.").format(word)) + if confirm is False: + await ctx.send( + _("This will toggle the bank to be {}, deleting all accounts " + "in the process! If you're sure, type `{}`").format( + word, "{}bankset toggleglobal yes".format(ctx.prefix) + ) + ) + else: + await bank.set_global(not cur_setting) + await ctx.send(_("The bank is now {}.").format(word)) @bankset.command(name="bankname") @check_global_setting_guildowner()