mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
[V3 Bank] Add confirmation prompt on [p]bankset toggleglobal (#1402)
This commit is contained in:
parent
5bdb455bc0
commit
4fcf32b5e9
@ -58,15 +58,22 @@ class Bank:
|
|||||||
|
|
||||||
@bankset.command(name="toggleglobal")
|
@bankset.command(name="toggleglobal")
|
||||||
@checks.is_owner()
|
@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
|
"""Toggles whether the bank is global or not
|
||||||
If the bank is global, it will become per-guild
|
If the bank is global, it will become per-guild
|
||||||
If the bank is per-guild, it will become global"""
|
If the bank is per-guild, it will become global"""
|
||||||
cur_setting = await bank.is_global()
|
cur_setting = await bank.is_global()
|
||||||
await bank.set_global(not cur_setting)
|
|
||||||
|
|
||||||
word = _("per-guild") if cur_setting else _("global")
|
word = _("per-guild") if cur_setting else _("global")
|
||||||
|
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))
|
await ctx.send(_("The bank is now {}.").format(word))
|
||||||
|
|
||||||
@bankset.command(name="bankname")
|
@bankset.command(name="bankname")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user