From a3c01cfe13cb5b1c2648e5370ca0ce2bdf29b95b Mon Sep 17 00:00:00 2001 From: Kamal Curi Date: Mon, 25 Sep 2023 18:29:54 -0300 Subject: [PATCH] ADD: Command lock --- utils/commands.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/utils/commands.py b/utils/commands.py index df4d97c..de76a34 100644 --- a/utils/commands.py +++ b/utils/commands.py @@ -31,6 +31,9 @@ with open(RQ_LEADERBOARD, mode='r') as f: quote_content = {} +comlock = {'roulette': False + } + drum = [] chamber = -1 @@ -541,8 +544,14 @@ async def roulette(bot:object) -> str: global drum global chamber + global comlock spin = 0 + if comlock['roulette'] == True: + return 0 + + comlock['roulette'] = True + if not drum: await bot.send("Inserting a bullet and spinning the drum...") drum.extend(['click']*6) @@ -554,8 +563,13 @@ async def roulette(bot:object) -> str: if drum[chamber] == 'bang': chamber = -1 drum = [] - return await bot.send(f"BANG! {bot.author.name} died.") + await bot.send(f"BANG! {bot.author.name} died.") + comlock['roulette'] = False + return 0 else: + await bot.send("Click!") + comlock['roulette'] = False + return 0 @client.command(aliases=['dbg']) async def neeble_debug(bot:object) -> str: