Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Elijah Steres 2020-12-31 17:56:33 -05:00
commit fb78892387
2 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,7 @@ def update_loop():
print(discrim_string) print(discrim_string)
state["leagueoruser"] = discrim_string state["leagueoruser"] = discrim_string
state["display_inning"] = this_game.inning #games need to be initialized with the following keys in state: 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["outs"] = this_game.outs #away_name
state["pitcher"] = this_game.get_pitcher().name #home_name state["pitcher"] = this_game.get_pitcher().name #home_name
state["batter"] = this_game.get_batter().name #max_innings state["batter"] = this_game.get_batter().name #max_innings

View File

@ -605,10 +605,13 @@ async def watch_game(channel, newgame, user = None, league = None):
if league is not None: if league is not None:
discrim_string = league discrim_string = league
state_init["is_league"] = True
elif user is not None: elif user is not None:
discrim_string = f"Started by {user.name}" discrim_string = f"Started by {user.name}"
state_init["is_league"] = False
else: else:
discrim_string = "Unclaimed game." 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']}") await channel.send(f"{newgame.teams['away'].name} vs. {newgame.teams['home'].name}, starting at {config()['simmadome_url']}")
gamesarray.append((newgame, channel, user)) gamesarray.append((newgame, channel, user))