diff --git a/cogs/gameplay.py b/cogs/gameplay.py index 303492d..557bfa1 100644 --- a/cogs/gameplay.py +++ b/cogs/gameplay.py @@ -1165,12 +1165,20 @@ class Gameplay(commands.Cog): if 'Minor' in league: league_name = 'minor-league' elif 'Flashback' in league: - await interaction.edit_original_response( - content='The **Flashback Campaign** will pit you against all 30 MLB clubs with both you and the AI ' - 'being limited to the 2008, 2012, 2013, and 2016 cardsets. This campaign will open up in ' - 'mid-November!' - ) - return + can_play = False + for x in interaction.user.roles: + if x.name == 'PD - Major League': + can_play = True + + if not can_play: + await interaction.edit_original_response( + content=f'Ope. Looks like you haven\'t completed the Minor League campaign, yet!\n\n' + f'To play **Flashback** games, you need to defeat all 30 MLB teams in the Minor League ' + f'campaign. You can see your progress with `/record`.\n\n' + f'If you have completed the Minor League campaign, go ping Cal to get your new role!') + return + league_name = 'flashback' + elif 'Major' in league: can_play = False for x in interaction.user.roles: @@ -1186,12 +1194,6 @@ class Gameplay(commands.Cog): return league_name = 'major-league' else: - await interaction.edit_original_response( - content='The **Hall of Fame Campaign** will pit you against all 30 MLB clubs with you ' - 'being limited to ranked-legal cardsets (2023 & 2018) and the AI having no limits. ' - 'This campaign will open up in December!' - ) - return can_play = False for x in interaction.user.roles: if x.name == 'PD - Hall of Fame': diff --git a/cogs/players.py b/cogs/players.py index b576bd6..e28fff3 100644 --- a/cogs/players.py +++ b/cogs/players.py @@ -516,7 +516,7 @@ class Players(commands.Cog): @app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME) async def record_slash_command( self, interaction: discord.Interaction, - league: Literal['All', 'Minor League', 'Major League', 'Hall of Fame'], + league: Literal['All', 'Minor League', 'Major League', 'Flashback', 'Hall of Fame'], team_abbrev: Optional[str] = None): ephemeral = False if interaction.channel.name in ['paper-dynasty-chat', 'pd-news-ticker']: @@ -543,51 +543,23 @@ class Players(commands.Cog): minor_embed = get_record_embed(team, st_query['minor-league'], 'Minor League') major_embed = get_record_embed(team, st_query['major-league'], 'Major League') + flashback_embed = get_record_embed(team, st_query['flashback'], 'Flashback') hof_embed = get_record_embed(team, st_query['hall-of-fame'], 'Hall of Fame') - # rs_query = await db_get( - # 'games', - # params=[('team_one_id', team['id']), ('season', current['season']), ('short_game', True)] - # ) - # rl_query = await db_get( - # 'results', - # params=[('team_one_id', team['id']), ('season', current['season']), ('short_game', False)] - # ) - # - # logging.debug(f'getting ai records...') - # all_results = get_ai_records(rs_query['results'], rl_query['results']) - # logging.debug(f'received ai records') - # - # logging.debug(f'getting embeds...') - # short_embed = get_team_embed(team['lname'], team) - # short_embed.description = '3-Inning Games' - # minor_embed = get_team_embed(team['lname'], team) - # minor_embed.description = 'Minor League Record' - # major_embed = get_team_embed(team['lname'], team) - # major_embed.description = 'Major League Record' - # hof_embed = get_team_embed(team['lname'], team) - # hof_embed.description = 'Hall of Fame Record' - # logging.debug(f'received embeds') - # - # logging.debug(f'getting short game embed...') - # short_embed = get_record_embed(short_embed, all_results, 'short') - # minor_embed = get_record_embed(minor_embed, all_results, 'minor') - # major_embed = get_record_embed(major_embed, all_results, 'major') - # hof_embed = get_record_embed(hof_embed, all_results, 'hof') - # logging.debug(f'received short game embed') - if league == 'All': start_page = 0 elif league == 'Minor League': start_page = 0 elif league == 'Major League': start_page = 1 - else: + elif league == 'Flashback': start_page = 2 + else: + start_page = 3 await interaction.edit_original_response(content=f'Here are the {team["lname"]} campaign records') await embed_pagination( - [minor_embed, major_embed, hof_embed], + [minor_embed, major_embed, flashback_embed, hof_embed], interaction.channel, interaction.user, timeout=20,