diff --git a/.gitignore b/.gitignore index 4e78b90..6b0dd66 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ secrets.env .env venv -__pycache__/ +src/__pycache__/ src/test.py \ No newline at end of file diff --git a/src/package/games/werewolf/cog.py b/src/package/games/werewolf/cog.py index d210fd1..65b88ca 100644 --- a/src/package/games/werewolf/cog.py +++ b/src/package/games/werewolf/cog.py @@ -37,18 +37,6 @@ 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): @@ -61,12 +49,6 @@ 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/package/games/werewolf/game.py b/src/package/games/werewolf/game.py index 34fe62d..4d1b9ee 100644 --- a/src/package/games/werewolf/game.py +++ b/src/package/games/werewolf/game.py @@ -3,7 +3,7 @@ import time import asyncio import discord from .roles import Role, Doppelganger, Werewolf, Minion, Mason, Seer, Robber, Troublemaker, Drunk, Insomniac, Tanner, Hunter, No_role -from .players import Werewolf_player, No_player +from .players import Player, No_player class Werewolf_game: @@ -27,7 +27,7 @@ class Werewolf_game: await asyncio.gather(*[call(p) for p in self.player_list]) async def set_players(self, msg): - self.player_list = [await Werewolf_player.make(mem, self) for mem in msg.mentions] + self.player_list = [await Player.make(mem, self) for mem in msg.mentions] await self.send(f"Players: {', '.join(p.name() for p in self.player_list)}") # send confirmation async def set_roles(self, suggestions): diff --git a/src/package/games/werewolf/players.py b/src/package/games/werewolf/players.py index 443f075..a17ab9c 100644 --- a/src/package/games/werewolf/players.py +++ b/src/package/games/werewolf/players.py @@ -1,7 +1,9 @@ +import discord + """Has a single class: Werewolf_player""" # local import -from ..players import Player +from .player import Player class Werewolf_player(Player): diff --git a/src/werewolf_bot.py b/src/werewolf_bot.py index 31a4a22..9fb47b9 100644 --- a/src/werewolf_bot.py +++ b/src/werewolf_bot.py @@ -50,4 +50,29 @@ 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)