From baab989507fb7176ba15a2a56f81202016ace505 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Thu, 15 Jun 2023 09:21:01 -0500 Subject: [PATCH] Cardset support --- cogs/admins.py | 11 +++++++---- cogs/players.py | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cogs/admins.py b/cogs/admins.py index 062e404..f7bf9ad 100644 --- a/cogs/admins.py +++ b/cogs/admins.py @@ -209,7 +209,8 @@ class Admins(commands.Cog): 'Starter': 3, 'Reserve': 4, 'Replacement': 5, - 'Hall of Fame': 99 + 'Hall of Fame': 99, + 'HoF': 99 } def new_cost(player, new_rarity, old_rarity): @@ -304,10 +305,11 @@ class Admins(commands.Cog): this_player = p_query['players'][0] updates = [] - if '0501' in this_player['image']: - updates.append(('image', this_player['image'].replace('2023-0501', '2023-0515'))) + if '0515' in this_player['image']: + updates.append(('image', this_player['image'].replace('2023-0515', '2023-0610'))) - if this_player['rarity']['name'] != row[9]: + if this_player['rarity']['name'] != row[9] and not \ + (this_player['rarity']['name'] == 'Hall of Fame' and row[9] == 'HoF'): new_r = rarities[row[9]] updates.append( ('cost', new_cost(this_player, new_r, rarities[this_player['rarity']['name']])) @@ -391,6 +393,7 @@ class Admins(commands.Cog): if len(errors) > 0: e_string = "\n- ".join(errors) + logging.error(f'update errors:\n{e_string}') await ctx.send(f'I encountered the following errors:\n\n{e_string}') @commands.command(name='tc', help='Mod: Test command') diff --git a/cogs/players.py b/cogs/players.py index d8641ac..0269761 100644 --- a/cogs/players.py +++ b/cogs/players.py @@ -368,8 +368,8 @@ class Players(commands.Cog): async def player_slash_command( self, interaction: discord.Interaction, player_name: str, cardset: Literal['All', '2008 Season', '2012 Season', '2013 Season', '2016 Season', '2019 Season', - '2021 Season', '2022 Season', '2022 Promos', '2023 Live', 'Mario Super Sluggers', - 'Sams Choice'] = 'All'): + '2021 Season', '2022 Season', '2022 Promos', '2023 Live', '2023 Promos', + 'Mario Super Sluggers', 'Sams Choice'] = 'All'): # min_rarity: Literal['Replacement', 'Reserve', 'Starter', 'All-Star', 'MVP'] = None): ephemeral = False if interaction.channel.name in ['paper-dynasty-chat', 'pd-news-ticker']: