From cbaafe0b856be520e1a355e50f2a7509a19817e2 Mon Sep 17 00:00:00 2001 From: bibin Date: Wed, 15 Jul 2020 16:59:30 +0200 Subject: [PATCH] moved werewolf specific commands to werewolf.cog --- src/package/games/werewolf/cog.py | 18 ++++++++++++++++++ src/werewolf_bot.py | 25 ------------------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/package/games/werewolf/cog.py b/src/package/games/werewolf/cog.py index 65b88ca..d210fd1 100644 --- a/src/package/games/werewolf/cog.py +++ b/src/package/games/werewolf/cog.py @@ -37,6 +37,18 @@ class Werewolf_cog(Game_cog, commands.Cog): """registers all mentioned players for the game""" await super().players(ctx) + @werewolf.command() + @commands.check(Game_cog.pre_game_check) + async def roles(self, ctx, *args): + """registers roles you want to play with""" + await self.game_instances[ctx.channel].set_roles(args) + + @werewolf.command() + @commands.check(Game_cog.pre_game_check) + async def minutes(self, ctx, i): + """set discussion time""" + await self.game_instances[ctx.channel].set_time(i) + @werewolf.command() @commands.check(Game_cog.pre_game_check) async def start(self, ctx): @@ -49,6 +61,12 @@ class Werewolf_cog(Game_cog, commands.Cog): """aborts the current round of werewolf""" await super().stop(ctx) + @werewolf.command() + @commands.check(Game_cog.in_game_check) + async def time(self, ctx): + """checks how much discussion time there is left""" + await self.send_friendly(ctx, self.game_instances[ctx.channel].remaining_time_string()) + def setup(bot): bot.add_cog(Werewolf_cog(bot, Werewolf_game)) diff --git a/src/werewolf_bot.py b/src/werewolf_bot.py index 9fb47b9..31a4a22 100644 --- a/src/werewolf_bot.py +++ b/src/werewolf_bot.py @@ -50,29 +50,4 @@ def error_handling(command): return wrapper ''' -''' - -# TODO: (specifig game) werewolf COG - -@game.command() -@game_not_running -@error_handling -async def roles(ctx, *args): - await game_instances[ctx.channel].set_roles(args) - - -@game.command() -@game_not_running -@error_handling -async def minutes(ctx, i): - await game_instances[ctx.channel].set_time(i) - - -@game.command() -@game_running -@error_handling -async def time(ctx): - await send_friendly(ctx, game_instances[ctx.channel].remaining_time_string()) -''' - bot.run(TOKEN)