Update key plays text
This commit is contained in:
parent
a81e07b8cc
commit
d32f319043
@ -1378,6 +1378,8 @@ class Players(commands.Cog):
|
|||||||
h_name = 'triples'
|
h_name = 'triples'
|
||||||
elif play['double'] == 1:
|
elif play['double'] == 1:
|
||||||
h_name = 'doubles'
|
h_name = 'doubles'
|
||||||
|
elif play['sac'] == 1:
|
||||||
|
h_name = 'sac flies'
|
||||||
else:
|
else:
|
||||||
h_name = 'singles'
|
h_name = 'singles'
|
||||||
logging.info('RBI?')
|
logging.info('RBI?')
|
||||||
@ -1431,7 +1433,23 @@ class Players(commands.Cog):
|
|||||||
play_string = 'retires the leadoff batter'
|
play_string = 'retires the leadoff batter'
|
||||||
this_line += f'{play["pitcher"]["name"]} ({play["pitcher"]["team"]["abbrev"]}) {play_string}'
|
this_line += f'{play["pitcher"]["name"]} ({play["pitcher"]["team"]["abbrev"]}) {play_string}'
|
||||||
|
|
||||||
key_plays += f'{this_line}\n'
|
if play['is_go_ahead']:
|
||||||
|
this_line += ' to take the lead'
|
||||||
|
|
||||||
|
a_score = play['away_score']
|
||||||
|
h_score = play['home_score']
|
||||||
|
if play['inning_half'] == 'top':
|
||||||
|
a_score += play['rbi']
|
||||||
|
else:
|
||||||
|
h_score += play['rbi']
|
||||||
|
if a_score > h_score:
|
||||||
|
score_string = f'{away_team["abbrev"]} up {a_score}-{h_score}'
|
||||||
|
elif h_score > a_score:
|
||||||
|
score_string = f'{home_team["abbrev"]} up {h_score}-{a_score}'
|
||||||
|
else:
|
||||||
|
score_string = f'tied at {a_score}'
|
||||||
|
|
||||||
|
key_plays += f'{this_line}, {score_string}\n'
|
||||||
|
|
||||||
if len(key_plays) > 0:
|
if len(key_plays) > 0:
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user