From 06629433b8a337d29efa308a1e61e9d79a148b46 Mon Sep 17 00:00:00 2001 From: Elnath Date: Sun, 20 Jun 2021 21:42:38 +0200 Subject: [PATCH] Added command to force a shuffle of the draw and discard --- SecretBot.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SecretBot.py b/SecretBot.py index af8c9bb..67cc10b 100755 --- a/SecretBot.py +++ b/SecretBot.py @@ -361,6 +361,17 @@ class SecretBot(commands.Cog): await self.check_is_administrator_or_gm(ctx) await game.veto() + @commands.command("ForceShuffle", help = "Force a shuffle of the discard into the draw pile") + async def force_shuffle_with_confirmation(self, ctx: commands.Context): + await self.check_is_administrator_or_gm(ctx) + await self.confirm_action("Are you sure that you want to force a shuffle of the discard and draw pile?", ctx.channel, self.force_shuffle(ctx), ctx.message) + + async def force_shuffle(self, ctx: commands.Context): + game = await self.get_running_game_or_error_message(ctx) + await self.check_is_administrator_or_gm(ctx) + await game.shuffle_discard_into_deck() + await ctx.reply(":white_check_mark: The discard and draw pile have been shuffled") + if __name__ == '__main__': argparser = argparse.ArgumentParser(description = "Secret Hitler helper bot", formatter_class = argparse.ArgumentDefaultsHelpFormatter)