From 2d6ba652b76692d28caf76155271fece6f85ecd5 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Thu, 31 Dec 2020 17:06:56 -0500 Subject: [PATCH] added is_league flag to game updates --- main_controller.py | 1 + the_prestige.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/main_controller.py b/main_controller.py index 51612e2..78b78ae 100644 --- a/main_controller.py +++ b/main_controller.py @@ -35,6 +35,7 @@ def update_loop(): print(discrim_string) state["leagueoruser"] = discrim_string state["display_inning"] = this_game.inning #games need to be initialized with the following keys in state: + #is_league, bool state["outs"] = this_game.outs #away_name state["pitcher"] = this_game.get_pitcher().name #home_name state["batter"] = this_game.get_batter().name #max_innings diff --git a/the_prestige.py b/the_prestige.py index 4905e76..9dff3cf 100644 --- a/the_prestige.py +++ b/the_prestige.py @@ -605,10 +605,13 @@ async def watch_game(channel, newgame, user = None, league = None): if league is not None: discrim_string = league + state_init["is_league"] = True elif user is not None: discrim_string = f"Started by {user.name}" + state_init["is_league"] = False else: discrim_string = "Unclaimed game." + state_init["is_league"] = False await channel.send(f"{newgame.teams['away'].name} vs. {newgame.teams['home'].name}, starting at {config()['simmadome_url']}") gamesarray.append((newgame, channel, user))