diff --git a/utils/commands.py b/utils/commands.py index 40d7a7f..b08000e 100644 --- a/utils/commands.py +++ b/utils/commands.py @@ -33,6 +33,9 @@ with open(RQ_LEADERBOARD, mode='r') as f: quote_content = {} +drum = [] +chamber = -1 + last_rq = {} last_rqer = '' rq_abusers = {} @@ -77,7 +80,7 @@ async def quote(bot: object, *quote: str) -> str: stack_limit = int((count_quotes() * .25)) return await bot.send(f"Done: `{quote}\n` ID: `{qtid}`") -@client.command(aliases=['g']) +@client.command(aliases=['g', 'grab']) async def grab_quote(bot: object, *author: str) -> str: """ Grabs the last thing someone said, and makes it into a quote. @@ -560,4 +563,32 @@ async def dice_roll(bot:object, size:int=6) -> str: """ syntax = '--dice_roll ' - return await bot.send(f":game_die: : `{str(randrange(1, size + 1))}`") \ No newline at end of file + return await bot.send(f":game_die: : `{str(randrange(1, size + 1))}`") + +@client.command(aliases=[]) +async def roulette(bot:object) -> str: + """ + Russian Roulette + """ + syntax = '--roulette' + + global drum + global chamber + + if not drum: + await bot.send("Inserting a bullet and spinning the drum...") + drum.extend(['click']*6) + print(drum) + spin = randrange(0, 5) + print(spin) + drum[spin] = 'bang' + print(drum) + + chamber+=1 + + if drum[chamber] == 'bang': + chamber = 0 + drum = [] + return await bot.send(f"BANG! {bot.author.name} died.") + else: + return await bot.send("Click!") \ No newline at end of file