From b2a2f24cc1c7f12a0900606307ce7a0e590e107f Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Sun, 3 Nov 2024 01:07:22 -0600 Subject: [PATCH] Update owner sync Set 1998 gauntlet opponents --- cogs/owner.py | 6 +++++- gauntlets.py | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/cogs/owner.py b/cogs/owner.py index e670da3..53c338d 100644 --- a/cogs/owner.py +++ b/cogs/owner.py @@ -108,9 +108,13 @@ class Owner(commands.Cog): ctx.bot.tree.copy_global_to(guild=ctx.guild) fmt = await ctx.bot.tree.sync(guild=ctx.guild) elif spec == '!': + fmt = await ctx.bot.tree.sync() + await ctx.send(f'Synced {len(fmt)} commands globally.') ctx.bot.tree.clear_commands(guild=ctx.guild) await ctx.send(f'Cleared all local commands.') - fmt = await ctx.bot.tree.sync(guild=ctx.guild) + if fmt > 0: + fmt = await ctx.bot.tree.sync(guild=ctx.guild) + await ctx.send(f'Synced global commands to this guild.') else: fmt = await ctx.bot.tree.sync() diff --git a/gauntlets.py b/gauntlets.py index db43675..a234bca 100644 --- a/gauntlets.py +++ b/gauntlets.py @@ -186,6 +186,32 @@ async def get_opponent(this_team, this_event, this_run): else: raise KeyError(f'Hmm...I do not know who you should be playing right now.') return await db_get('teams', object_id=t_id, none_okay=False) + elif this_event['id'] == 6: + if gp == 0: + t_id = 30 + elif gp == 1: + t_id = 22 + elif gp == 2: + t_id = 7 + elif gp == 3: + t_id = 8 + elif gp == 4: + t_id = 16 + elif gp == 5: + t_id = 6 + elif gp == 6: + t_id = 24 + elif gp == 7: + t_id = 15 + elif gp == 8: + t_id = 13 + elif gp == 9: + t_id = 1 + elif gp == 10: + t_id = 29 + else: + raise KeyError(f'Hmm...I do not know who you should be playing right now.') + return await db_get('teams', object_id=t_id, none_okay=False) else: return None @@ -1639,18 +1665,23 @@ async def post_result(run_id: int, is_win: bool, this_team, bot, channel): await helpers.give_cards_to_team( main_team, player_ids=[x['reward']['player']['player_id']], pack_id=this_pack['id']) reward_string += f'- {helpers.player_desc(x["reward"]["player"])}\n' - elif x['reward']['pack_type'] and this_event['id'] in [3, 4, 5]: + elif x['reward']['pack_type'] and this_event['id'] in [3, 4, 5, 6]: if this_event['id'] == 3: cardset_id = 13 team_id = 58 elif this_event['id'] == 4: cardset_id = 16 team_id = 79 - else: + elif this_event['id'] == 5: cardset_id = 17 team_id = None if x['reward']['pack_type']['id'] == 9: cardset_id = 18 + else: + cardset_id = 20 + team_id = None + if x['reward']['pack_type']['id'] == 9: + cardset_id = 21 await db_post( 'packs', payload={'packs': [{ 'team_id': main_team['id'],