From 3ee7c7136229aa0b234a65cb12114a66ae95185b Mon Sep 17 00:00:00 2001 From: Sakimori Date: Thu, 31 Dec 2020 14:09:50 -0500 Subject: [PATCH] added --league [league name] flag to startgame (also -l [league name]) --- the_prestige.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/the_prestige.py b/the_prestige.py index dbc08c9..f8a6196 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -114,10 +114,16 @@ class StartGameCommand(Command): - and finally, optionally, the number of innings, which must be greater than 2 and less than 31. if not included it will default to 9.""" async def execute(self, msg, command): + league = None if config()["game_freeze"]: await msg.channel.send("Patch incoming. We're not allowing new games right now.") return + if "-l " in command.split("\n")[0]: + league = command.split("\n")[0].split("-l ")[1] + elif "--league " in command.split("\n")[0]: + league = command.split("\n")[0].split("--league ")[1] + try: team_name1 = command.split("\n")[1].strip() team1 = games.get_team(team_name1) @@ -167,7 +173,7 @@ class StartGameCommand(Command): channel = msg.channel await msg.delete() - game_task = asyncio.create_task(watch_game(channel, game, user=msg.author)) + game_task = asyncio.create_task(watch_game(channel, game, user=msg.author, league=league)) await game_task class SetupGameCommand(Command):