added is_league flag to game updates
This commit is contained in:
parent
0ed85a7975
commit
2d6ba652b7
|
@ -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
|
||||||
|
|
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user