Add scorecard version check
This commit is contained in:
parent
ddd5c08f96
commit
d60c6a1957
@ -177,8 +177,7 @@ class Players(commands.Cog):
|
|||||||
embed = get_team_embed('SBa Scoreboard')
|
embed = get_team_embed('SBa Scoreboard')
|
||||||
embed.add_field(name='Live Games', value="\n\n".join(game_strings))
|
embed.add_field(name='Live Games', value="\n\n".join(game_strings))
|
||||||
embed.set_footer(
|
embed.set_footer(
|
||||||
text=f'SBa Season {SBA_SEASON} - I hope you are having a great day unless your last name '
|
text=f'SBa Season {SBA_SEASON}',
|
||||||
f'starts with "castag".',
|
|
||||||
icon_url=LOGO
|
icon_url=LOGO
|
||||||
)
|
)
|
||||||
await score_channel.set_permissions(player_role, read_messages=True)
|
await score_channel.set_permissions(player_role, read_messages=True)
|
||||||
@ -1119,6 +1118,16 @@ class Players(commands.Cog):
|
|||||||
# Get outline data from the sheet
|
# Get outline data from the sheet
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
setup_tab = scorecard.worksheet_by_title('Setup')
|
setup_tab = scorecard.worksheet_by_title('Setup')
|
||||||
|
|
||||||
|
scorecard_version = setup_tab.get_value('V35')
|
||||||
|
if int(scorecard_version) != current['bet_week']:
|
||||||
|
await interaction.edit_original_response(
|
||||||
|
content=f'It looks like this scorecard is out of date. Did you create a new card at the start of the '
|
||||||
|
f'game? If you did, let Cal know about this error. If not, I\'ll need you to use an up to '
|
||||||
|
f'date card.'
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
g_data = setup_tab.get_values('C3', 'D7')
|
g_data = setup_tab.get_values('C3', 'D7')
|
||||||
# setup_vals = setup_tab.get_values('B7', 'R33')
|
# setup_vals = setup_tab.get_values('B7', 'R33')
|
||||||
week_num = g_data[1][0]
|
week_num = g_data[1][0]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user