Bug fixes
Fixed end of gauntlet ping bug Fixed "too many dupes" bug
This commit is contained in:
parent
1ca1e538af
commit
e46955a16d
@ -909,9 +909,12 @@ class Economy(commands.Cog):
|
|||||||
player_ids = []
|
player_ids = []
|
||||||
dupe_ids = ''
|
dupe_ids = ''
|
||||||
dupe_cards = []
|
dupe_cards = []
|
||||||
dupe_string = ''
|
dupe_strings = ['' for x in range(20)]
|
||||||
|
str_count = 0
|
||||||
|
|
||||||
for card in c_query['cards']:
|
for card in c_query['cards']:
|
||||||
|
if len(dupe_strings[str_count]) > 1500:
|
||||||
|
str_count += 1
|
||||||
logging.debug(f'card: {card}')
|
logging.debug(f'card: {card}')
|
||||||
if card['player']['player_id'] not in player_ids:
|
if card['player']['player_id'] not in player_ids:
|
||||||
logging.debug(f'not a dupe')
|
logging.debug(f'not a dupe')
|
||||||
@ -920,16 +923,23 @@ class Economy(commands.Cog):
|
|||||||
logging.info(f'{team["abbrev"]} duplicate card: {card["id"]}')
|
logging.info(f'{team["abbrev"]} duplicate card: {card["id"]}')
|
||||||
dupe_cards.append(card)
|
dupe_cards.append(card)
|
||||||
dupe_ids += f'{card["id"]},'
|
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'
|
f'{card["player"]["cardset"]["name"]}\n'
|
||||||
|
|
||||||
if len(dupe_cards) == 0:
|
if len(dupe_cards) == 0:
|
||||||
await interaction.edit_original_response(content=f'You currently have 0 duplicate cards!')
|
await interaction.edit_original_response(content=f'You currently have 0 duplicate cards!')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
logging.info(f'sending first message / length {len(dupe_strings[0])}')
|
||||||
await interaction.edit_original_response(
|
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:
|
if not immediately:
|
||||||
view = Confirm(responders=[interaction.user])
|
view = Confirm(responders=[interaction.user])
|
||||||
@ -956,7 +966,6 @@ class Economy(commands.Cog):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
await refresh_sheet(team, self.bot)
|
|
||||||
team = await db_get('teams', object_id=team['id'])
|
team = await db_get('teams', object_id=team['id'])
|
||||||
await interaction.channel.send(f'Your Wallet: {team["wallet"]}₼')
|
await interaction.channel.send(f'Your Wallet: {team["wallet"]}₼')
|
||||||
|
|
||||||
|
|||||||
@ -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'
|
reward_string += f'- 1x {x["reward"]["pack_type"]["name"]} Pack'
|
||||||
|
|
||||||
if this_run['wins'] == 10:
|
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(
|
await send_to_channel(
|
||||||
bot,
|
bot,
|
||||||
'pd-network-news',
|
'pd-network-news',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user