Bug fixes

Fixed end of gauntlet ping bug
Fixed "too many dupes" bug
This commit is contained in:
Cal Corum 2023-10-28 10:58:43 -05:00
parent 1ca1e538af
commit e46955a16d
2 changed files with 14 additions and 5 deletions

View File

@ -909,9 +909,12 @@ class Economy(commands.Cog):
player_ids = []
dupe_ids = ''
dupe_cards = []
dupe_string = ''
dupe_strings = ['' for x in range(20)]
str_count = 0
for card in c_query['cards']:
if len(dupe_strings[str_count]) > 1500:
str_count += 1
logging.debug(f'card: {card}')
if card['player']['player_id'] not in player_ids:
logging.debug(f'not a dupe')
@ -920,16 +923,23 @@ class Economy(commands.Cog):
logging.info(f'{team["abbrev"]} duplicate card: {card["id"]}')
dupe_cards.append(card)
dupe_ids += f'{card["id"]},'
dupe_string += f'{card["player"]["rarity"]["name"]} {card["player"]["p_name"]} - ' \
dupe_strings[str_count] += f'{card["player"]["rarity"]["name"]} {card["player"]["p_name"]} - ' \
f'{card["player"]["cardset"]["name"]}\n'
if len(dupe_cards) == 0:
await interaction.edit_original_response(content=f'You currently have 0 duplicate cards!')
return
logging.info(f'sending first message / length {len(dupe_strings[0])}')
await interaction.edit_original_response(
content=f'You currently have {len(dupe_cards)} duplicate cards:\n\n{dupe_string}'
content=f'You currently have {len(dupe_cards)} duplicate cards:\n\n{dupe_strings[0]}'
)
for x in dupe_strings[1:]:
logging.info(f'checking string: {len(x)}')
if len(x) > 0:
await interaction.channel.send(x)
else:
break
if not immediately:
view = Confirm(responders=[interaction.user])
@ -956,7 +966,6 @@ class Economy(commands.Cog):
)
return
await refresh_sheet(team, self.bot)
team = await db_get('teams', object_id=team['id'])
await interaction.channel.send(f'Your Wallet: {team["wallet"]}')

View File

@ -1059,7 +1059,7 @@ async def post_result(run_id: int, is_win: bool, this_team, bot, channel):
reward_string += f'- 1x {x["reward"]["pack_type"]["name"]} Pack'
if this_run['wins'] == 10:
choas_role = await get_or_create_role(channel.guild, "CHOAS ALERT", mentionable=True)
choas_role = await get_or_create_role(channel, "CHOAS ALERT", mentionable=True)
await send_to_channel(
bot,
'pd-network-news',