2024 Updates
This commit is contained in:
parent
89c0c508db
commit
a40c1c9e93
@ -18,12 +18,12 @@ db = SqliteDatabase(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
# 2018, Mario
|
# 2024, Mario
|
||||||
MINOR_CARDSET_PARAMS = [('cardset_id', 8), ('cardset_id', 13)]
|
MINOR_CARDSET_PARAMS = [('cardset_id', 17), ('cardset_id', 8)]
|
||||||
|
|
||||||
# 2018, 2023, Mario, 2013
|
# 2018, 2024, Mario,
|
||||||
MAJOR_CARDSET_PARAMS = [
|
MAJOR_CARDSET_PARAMS = [
|
||||||
('cardset_id', 9), ('cardset_id', 8), ('cardset_id', 6), ('cardset_id', 13)
|
('cardset_id', 13), ('cardset_id', 14), ('cardset_id', 17), ('cardset_id', 18), ('cardset_id', 8)
|
||||||
]
|
]
|
||||||
|
|
||||||
# 2008, 2012, 2013, 2016, 2019, 2021, 2022, 2023, Mario
|
# 2008, 2012, 2013, 2016, 2019, 2021, 2022, 2023, Mario
|
||||||
|
|||||||
@ -423,17 +423,17 @@ class Economy(commands.Cog):
|
|||||||
embed.description = 'Cardset Requirements'
|
embed.description = 'Cardset Requirements'
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name='Ranked Legal',
|
name='Ranked Legal',
|
||||||
value='2018 Season, 2023 Season, 2023 Promos',
|
value='2024 Season + Promos, 2018 Season + Promos',
|
||||||
inline=False
|
inline=False
|
||||||
)
|
)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name='Minor League',
|
name='Minor League',
|
||||||
value='Humans: Unlimited\nAI: 2018 Season / 2023 & 2022 Seasons as backup',
|
value='Humans: Unlimited\nAI: 2024 Season / 2018 Season as backup',
|
||||||
inline=False
|
inline=False
|
||||||
)
|
)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name='Major League',
|
name='Major League',
|
||||||
value='Humans: Ranked Legal\nAI: 2023, 2018, 2013, 2008 Seasons / 2022 & 2019 as backup',
|
value='Humans: Ranked Legal\nAI: 2024, 2018, 2016, 2008 Seasons / 2023 & 2022 as backup',
|
||||||
inline=False
|
inline=False
|
||||||
)
|
)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
|
|||||||
@ -290,8 +290,31 @@ class Players(commands.Cog):
|
|||||||
self.sheets = pygsheets.authorize(service_file='storage/paper-dynasty-service-creds.json', retries=1)
|
self.sheets = pygsheets.authorize(service_file='storage/paper-dynasty-service-creds.json', retries=1)
|
||||||
self.player_list = []
|
self.player_list = []
|
||||||
self.cardset_list = []
|
self.cardset_list = []
|
||||||
|
self.freeze = False
|
||||||
|
|
||||||
self.build_player_list.start()
|
self.build_player_list.start()
|
||||||
|
self.weekly_loop.start()
|
||||||
|
|
||||||
|
@tasks.loop(hours=1)
|
||||||
|
async def weekly_loop(self):
|
||||||
|
current = await db_get('current')
|
||||||
|
now = datetime.datetime.now()
|
||||||
|
logging.debug(f'Datetime: {now} / weekday: {now.weekday()}')
|
||||||
|
|
||||||
|
# Begin Freeze
|
||||||
|
# if now.weekday() == 0 and now.hour == 5 and not current['freeze']: # Spring/Summer
|
||||||
|
if now.weekday() == 0 and now.hour == 0 and not current['freeze']: # Fall/Winter
|
||||||
|
current['week'] += 1
|
||||||
|
await db_patch('current', object_id=current['id'], params=[('week', current['week'])])
|
||||||
|
|
||||||
|
# End Freeze
|
||||||
|
# elif now.weekday() == 5 and now.hour == 5 and current['freeze']: # Spring/Summer
|
||||||
|
# elif now.weekday() == 5 and now.hour == 0 and current['freeze']: # Fall/Winter
|
||||||
|
# await db_patch('current', object_id=current['id'], params=[('freeze', False)])
|
||||||
|
|
||||||
|
@weekly_loop.before_loop
|
||||||
|
async def before_notif_check(self):
|
||||||
|
await self.bot.wait_until_ready()
|
||||||
|
|
||||||
async def cog_command_error(self, ctx, error):
|
async def cog_command_error(self, ctx, error):
|
||||||
await ctx.send(f'{error}')
|
await ctx.send(f'{error}')
|
||||||
@ -418,7 +441,8 @@ class Players(commands.Cog):
|
|||||||
self, interaction: discord.Interaction, player_name: str,
|
self, interaction: discord.Interaction, player_name: str,
|
||||||
cardset: Literal['All', '2008 Season', '2012 Season', '2013 Season', '2016 Season', '2018 Season',
|
cardset: Literal['All', '2008 Season', '2012 Season', '2013 Season', '2016 Season', '2018 Season',
|
||||||
'2019 Season', '2021 Season', '2022 Season', '2022 Promos', '2023 Season', '2023 Promos',
|
'2019 Season', '2021 Season', '2022 Season', '2022 Promos', '2023 Season', '2023 Promos',
|
||||||
'Backyard Baseball', 'Mario Super Sluggers', 'Sams Choice'] = 'All'):
|
'2024 Live', '2024 Promos','Backyard Baseball', 'Mario Super Sluggers',
|
||||||
|
'Sams Choice'] = 'All'):
|
||||||
# min_rarity: Literal['Replacement', 'Reserve', 'Starter', 'All-Star', 'MVP'] = None):
|
# min_rarity: Literal['Replacement', 'Reserve', 'Starter', 'All-Star', 'MVP'] = None):
|
||||||
ephemeral = False
|
ephemeral = False
|
||||||
if interaction.channel.name in ['paper-dynasty-chat', 'pd-news-ticker']:
|
if interaction.channel.name in ['paper-dynasty-chat', 'pd-news-ticker']:
|
||||||
|
|||||||
@ -643,6 +643,7 @@ class SelectOpenPack(discord.ui.Select):
|
|||||||
class SelectPaperdexCardset(discord.ui.Select):
|
class SelectPaperdexCardset(discord.ui.Select):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
options = [
|
options = [
|
||||||
|
discord.SelectOption(label='2024 Live'),
|
||||||
discord.SelectOption(label='2023 Season'),
|
discord.SelectOption(label='2023 Season'),
|
||||||
discord.SelectOption(label='2022 Season'),
|
discord.SelectOption(label='2022 Season'),
|
||||||
discord.SelectOption(label='2022 Promos'),
|
discord.SelectOption(label='2022 Promos'),
|
||||||
@ -682,6 +683,10 @@ class SelectPaperdexCardset(discord.ui.Select):
|
|||||||
cardset_id = 12
|
cardset_id = 12
|
||||||
elif self.values[0] == '2018 Season':
|
elif self.values[0] == '2018 Season':
|
||||||
cardset_id = 13
|
cardset_id = 13
|
||||||
|
elif self.values[0] == '2024 Live':
|
||||||
|
cardset_id = 17
|
||||||
|
elif self.values[0] == '2024 Promos':
|
||||||
|
cardset_id = 18
|
||||||
|
|
||||||
c_query = await db_get('cardsets', object_id=cardset_id, none_okay=False)
|
c_query = await db_get('cardsets', object_id=cardset_id, none_okay=False)
|
||||||
await interaction.response.edit_message(content=f'Okay, sifting through your cards...', view=None)
|
await interaction.response.edit_message(content=f'Okay, sifting through your cards...', view=None)
|
||||||
@ -809,6 +814,7 @@ class SelectPaperdexTeam(discord.ui.Select):
|
|||||||
class SelectBuyPacksCardset(discord.ui.Select):
|
class SelectBuyPacksCardset(discord.ui.Select):
|
||||||
def __init__(self, team: dict, quantity: int, pack_type_id: int, pack_embed: discord.Embed, cost: int):
|
def __init__(self, team: dict, quantity: int, pack_type_id: int, pack_embed: discord.Embed, cost: int):
|
||||||
options = [
|
options = [
|
||||||
|
discord.SelectOption(label='2024 Live'),
|
||||||
discord.SelectOption(label='2023 Season'),
|
discord.SelectOption(label='2023 Season'),
|
||||||
discord.SelectOption(label='2022 Season'),
|
discord.SelectOption(label='2022 Season'),
|
||||||
discord.SelectOption(label='2021 Season'),
|
discord.SelectOption(label='2021 Season'),
|
||||||
@ -847,6 +853,8 @@ class SelectBuyPacksCardset(discord.ui.Select):
|
|||||||
cardset_id = 12
|
cardset_id = 12
|
||||||
elif self.values[0] == '2018 Season':
|
elif self.values[0] == '2018 Season':
|
||||||
cardset_id = 13
|
cardset_id = 13
|
||||||
|
elif self.values[0] == '2024 Live':
|
||||||
|
cardset_id = 13
|
||||||
|
|
||||||
self.pack_embed.description = f'{self.pack_embed.description} - {self.values[0]}'
|
self.pack_embed.description = f'{self.pack_embed.description} - {self.values[0]}'
|
||||||
view = Confirm(responders=[interaction.user], timeout=30)
|
view = Confirm(responders=[interaction.user], timeout=30)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user