Prod push for Season 8 Updates
This commit is contained in:
parent
b2a2f24cc1
commit
d02e973499
@ -138,34 +138,59 @@ class Admins(commands.Cog):
|
|||||||
|
|
||||||
@group_give.command(name='packs')
|
@group_give.command(name='packs')
|
||||||
async def give_packs_subcommand(
|
async def give_packs_subcommand(
|
||||||
self, interaction: discord.Interaction, num_packs: int, pack_type: Literal['Standard', 'Premium', 'MVP'],
|
self, interaction: discord.Interaction, team_abbrevs: str, num_packs: int, pack_type: Literal['Standard', 'Premium', 'MVP'], cardset_id: int = None):
|
||||||
team_abbrevs: str):
|
|
||||||
if not owner_only(interaction):
|
if not owner_only(interaction):
|
||||||
await interaction.response.send_message(random_no_gif())
|
await interaction.response.send_message(random_no_gif())
|
||||||
return
|
return
|
||||||
|
|
||||||
current = await db_get('current')
|
current = await db_get('current')
|
||||||
await interaction.response.defer()
|
await interaction.response.defer()
|
||||||
|
|
||||||
p_query = await db_get('packtypes', params=[('name', pack_type)])
|
p_query = await db_get('packtypes', params=[('name', pack_type)])
|
||||||
|
if p_query['count'] == 0:
|
||||||
|
raise KeyError(f'Packtype not found')
|
||||||
|
this_packtype = p_query['packtypes'][0]
|
||||||
|
|
||||||
|
c_id = None
|
||||||
|
if cardset_id is not None:
|
||||||
|
cardset = await db_get('cardsets', object_id=cardset_id, none_okay=False)
|
||||||
|
c_id = cardset['id']
|
||||||
|
|
||||||
response = ''
|
response = ''
|
||||||
for x in team_abbrevs.split(' '):
|
for x in team_abbrevs.split(' '):
|
||||||
|
if x.upper() == 'LEAGUE':
|
||||||
|
all_teams = await db_get('teams', params=[('season', current['season'])])
|
||||||
|
total_teams = 0
|
||||||
|
for y in all_teams['teams']:
|
||||||
|
if not y['is_ai'] and 'gauntlet' not in y['abbrev'].lower():
|
||||||
|
logging.warning(f'Giving {num_packs} pack(s) to team: {y["abbrev"]}')
|
||||||
|
await db_post(
|
||||||
|
'packs',
|
||||||
|
payload={'packs': [{
|
||||||
|
'team_id': y['id'],
|
||||||
|
'pack_type_id': this_packtype['id'],
|
||||||
|
'pack_cardset_id': c_id
|
||||||
|
} for x in range(num_packs)]}
|
||||||
|
)
|
||||||
|
total_teams += 1
|
||||||
|
|
||||||
|
response = f'Just gave all {total_teams} teams {num_packs} ' \
|
||||||
|
f'{pack_type} pack{"s" if num_packs > 1 else ""}!'
|
||||||
|
|
||||||
|
else:
|
||||||
t_query = await db_get('teams', params=[('abbrev', x), ('season', current['season'])])
|
t_query = await db_get('teams', params=[('abbrev', x), ('season', current['season'])])
|
||||||
|
if t_query['count'] > 0:
|
||||||
team = t_query['teams'][0]
|
team = t_query['teams'][0]
|
||||||
|
|
||||||
if team:
|
await db_post(
|
||||||
total_packs = await give_packs(team, num_packs, pack_type=p_query['packtypes'][0])
|
'packs',
|
||||||
response += f'Just gave {num_packs} {pack_type} pack{"s" if num_packs > 1 else ""} to the ' \
|
payload={'packs': [{
|
||||||
f'{team["sname"]}. They now have {total_packs["count"]} ' \
|
'team_id': team['id'],
|
||||||
f'pack{"s" if total_packs["count"] > 1 else ""}.\n'
|
'pack_type_id': this_packtype['id'],
|
||||||
|
'pack_cardset_id': c_id
|
||||||
elif x.upper() == 'LEAGUE':
|
} for x in range(num_packs)]}
|
||||||
all_teams = await db_get('teams', params=[('season', current['season'])])
|
)
|
||||||
for y in all_teams['teams']:
|
response += f'Just gave {num_packs} {pack_type} pack{"s" if num_packs > 1 else ""} to the {team["sname"]}.'
|
||||||
logging.warning(f'Giving {num_packs} pack(s) to team: {y["abbrev"]}')
|
|
||||||
await give_packs(team, num_packs)
|
|
||||||
response = f'Just gave all {all_teams["count"]} teams {num_packs} ' \
|
|
||||||
f'standard pack{"s" if num_packs > 1 else ""}!'
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
await interaction.edit_original_response(content=f'Hmm...I\'m not sure who **{x.upper()}** is.')
|
await interaction.edit_original_response(content=f'Hmm...I\'m not sure who **{x.upper()}** is.')
|
||||||
|
|||||||
@ -16,25 +16,10 @@ from typing import Optional, Literal
|
|||||||
from discord.app_commands import Choice
|
from discord.app_commands import Choice
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import pygsheets
|
import in_game
|
||||||
from db_calls import db_get, db_post, db_patch, db_delete, get_team_by_abbrev
|
from db_calls import db_get, db_post, db_patch, db_delete, get_team_by_abbrev
|
||||||
from help_text import *
|
from help_text import *
|
||||||
|
|
||||||
# date = f'{datetime.datetime.now().year}-{datetime.datetime.now().month}-{datetime.datetime.now().day}'
|
|
||||||
# logging.basicConfig(
|
|
||||||
# filename=f'logs/{date}.log',
|
|
||||||
# format='%(asctime)s - %(levelname)s - %(message)s',
|
|
||||||
# level=logging.WARNING
|
|
||||||
# )
|
|
||||||
|
|
||||||
|
|
||||||
# async def legal_channel(ctx):
|
|
||||||
# bad_channels = ['paper-dynasty-chat', 'pd-news-ticker']
|
|
||||||
# if ctx.message.channel.name in bad_channels:
|
|
||||||
# raise discord.ext.commands.CheckFailure(f'Slide on down to the {get_channel(ctx, "pd-bot-hole").mention} ;)')
|
|
||||||
# else:
|
|
||||||
# return True
|
|
||||||
|
|
||||||
|
|
||||||
class Economy(commands.Cog):
|
class Economy(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
@ -426,22 +411,22 @@ 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='2024 Season + Promos, 2018 Season + Promos',
|
value='1998 Live + Promos, 2024 Season + Promos',
|
||||||
inline=False
|
inline=False
|
||||||
)
|
)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name='Minor League',
|
name='Minor League',
|
||||||
value='Humans: Unlimited\nAI: 2024 Season / 2018 Season as backup',
|
value='Humans: Unlimited\nAI: 1998 Live / 2008 Season as backup',
|
||||||
inline=False
|
inline=False
|
||||||
)
|
)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name='Major League',
|
name='Major League',
|
||||||
value='Humans: Ranked Legal\nAI: 2024, 2018, 2016, 2008 Seasons / 2023 & 2022 as backup',
|
value='Humans: Ranked Legal\nAI: 1998 Live + Promos, 2024 + Promos, 2013, 2008 Seasons / 2019 & 2022 as backup',
|
||||||
inline=False
|
inline=False
|
||||||
)
|
)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name='Flashback',
|
name='Flashback (SBa Rerun)',
|
||||||
value='2016, 2013, 2012, 2008 Seasons',
|
value='2019, 2021, 2022, 2023 Seasons',
|
||||||
inline=False
|
inline=False
|
||||||
)
|
)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
@ -1630,6 +1615,8 @@ class Economy(commands.Cog):
|
|||||||
team = await db_patch('teams', object_id=team['id'], params=[('gsheet', new_sheet.id)])
|
team = await db_patch('teams', object_id=team['id'], params=[('gsheet', new_sheet.id)])
|
||||||
await refresh_sheet(team, self.bot, sheets)
|
await refresh_sheet(team, self.bot, sheets)
|
||||||
|
|
||||||
|
in_game.data_cache.TEAM_CACHE = {}
|
||||||
|
|
||||||
conf_message = f'Alright, your sheet is linked to your team - good luck'
|
conf_message = f'Alright, your sheet is linked to your team - good luck'
|
||||||
if owner_team == team:
|
if owner_team == team:
|
||||||
conf_message += ' this season!'
|
conf_message += ' this season!'
|
||||||
@ -1638,58 +1625,6 @@ class Economy(commands.Cog):
|
|||||||
conf_message += f'\n\n{HELP_SHEET_SCRIPTS}'
|
conf_message += f'\n\n{HELP_SHEET_SCRIPTS}'
|
||||||
await response.edit(content=f'{conf_message}')
|
await response.edit(content=f'{conf_message}')
|
||||||
|
|
||||||
# @commands.hybrid_command(name='refresh', help='Refresh team data in Sheets')
|
|
||||||
# @commands.has_any_role(PD_PLAYERS)
|
|
||||||
# async def update_team(self, ctx):
|
|
||||||
# if not await legal_channel(ctx):
|
|
||||||
# await ctx.send(f'Slide on down to the {get_channel(ctx, "pd-bot-hole").mention} ;)')
|
|
||||||
# return
|
|
||||||
#
|
|
||||||
# team = await get_team_by_owner(ctx.author.id)
|
|
||||||
# if not team:
|
|
||||||
# await ctx.send(
|
|
||||||
# f'I don\'t see a team for you, yet. You can sign up with the `/newteam` command!'
|
|
||||||
# )
|
|
||||||
# return
|
|
||||||
#
|
|
||||||
# await refresh_sheet(team, self.bot)
|
|
||||||
# await ctx.send(random_conf_gif())
|
|
||||||
#
|
|
||||||
# # if abbrev and self.bot.is_owner(ctx.author):
|
|
||||||
# # team = Team.get_season(abbrev[0])
|
|
||||||
# # else:
|
|
||||||
# # team = Team.get_by_owner(ctx.author.id)
|
|
||||||
# # if not team:
|
|
||||||
# # await ctx.send('Now you wait just a second. You don\'t have a team!')
|
|
||||||
# # return
|
|
||||||
# #
|
|
||||||
# # # Get data from Sheets
|
|
||||||
# # roster_data = await self.get_collection(ctx, team)
|
|
||||||
# #
|
|
||||||
# # # Cut any marked players
|
|
||||||
# # comp_trade = True
|
|
||||||
# # if len(roster_data['cut']) > 0:
|
|
||||||
# # comp_trade = await self.cut_players(ctx, team, roster_data['cut'])
|
|
||||||
# #
|
|
||||||
# # if not comp_trade:
|
|
||||||
# # return
|
|
||||||
# #
|
|
||||||
# # # Set new rostered list
|
|
||||||
# # self.set_rostered_players(team, roster_data['rostered'])
|
|
||||||
# #
|
|
||||||
# # # Send current data to Sheets
|
|
||||||
# # if not await self.write_collection(ctx, team, extra=len(roster_data['cut'])):
|
|
||||||
# # logging.error(f'There was an issue trying to update the {team.sname} roster.')
|
|
||||||
# # await helpers.pause_then_type(ctx, 'Yikes. I had an issue with Sheets. Send help.')
|
|
||||||
# # else:
|
|
||||||
# # await helpers.pause_then_type(ctx, 'Alrighty, your sheet is all up to date!')
|
|
||||||
# # if team.logo:
|
|
||||||
# # thumb = team.logo
|
|
||||||
# # else:
|
|
||||||
# # thumb = self.bot.get_user(team.gmid).avatar_url
|
|
||||||
# # await ctx.send(content=None, embed=helpers.get_active_roster(team, thumb))
|
|
||||||
# #
|
|
||||||
# # db.close()
|
|
||||||
|
|
||||||
@commands.hybrid_command(name='give-card', help='Mod: Give free card to team')
|
@commands.hybrid_command(name='give-card', help='Mod: Give free card to team')
|
||||||
# @commands.is_owner()
|
# @commands.is_owner()
|
||||||
|
|||||||
@ -112,7 +112,7 @@ class Owner(commands.Cog):
|
|||||||
await ctx.send(f'Synced {len(fmt)} commands globally.')
|
await ctx.send(f'Synced {len(fmt)} commands globally.')
|
||||||
ctx.bot.tree.clear_commands(guild=ctx.guild)
|
ctx.bot.tree.clear_commands(guild=ctx.guild)
|
||||||
await ctx.send(f'Cleared all local commands.')
|
await ctx.send(f'Cleared all local commands.')
|
||||||
if fmt > 0:
|
if len(fmt) > 0:
|
||||||
fmt = await ctx.bot.tree.sync(guild=ctx.guild)
|
fmt = await ctx.bot.tree.sync(guild=ctx.guild)
|
||||||
await ctx.send(f'Synced global commands to this guild.')
|
await ctx.send(f'Synced global commands to this guild.')
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -446,7 +446,7 @@ class Players(commands.Cog):
|
|||||||
@app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME)
|
@app_commands.checks.has_any_role(PD_PLAYERS_ROLE_NAME)
|
||||||
async def player_slash_command(
|
async def player_slash_command(
|
||||||
self, interaction: discord.Interaction, player_name: str,
|
self, interaction: discord.Interaction, player_name: str,
|
||||||
cardset: Literal['All', '2024 Season', '2024 Promos', '2023 Season', '2023 Promos', '2022 Season',
|
cardset: Literal['All', '1998 Live', '1998 Promos', '2024 Season', '2024 Promos', '2023 Season', '2023 Promos', '2022 Season',
|
||||||
'2022 Promos', '2021 Season', '2019 Season', '2018 Season', '2018 Promos', '2016 Season', '2013 Season',
|
'2022 Promos', '2021 Season', '2019 Season', '2018 Season', '2018 Promos', '2016 Season', '2013 Season',
|
||||||
'2012 Season', '2008 Season', 'Backyard Baseball', 'Mario Super Sluggers', 'Sams Choice'] = 'All'):
|
'2012 Season', '2008 Season', '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):
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import os
|
|||||||
AUTH_TOKEN = {'Authorization': f'Bearer {os.environ.get("API_TOKEN")}'}
|
AUTH_TOKEN = {'Authorization': f'Bearer {os.environ.get("API_TOKEN")}'}
|
||||||
DB_URL = 'https://pd.manticorum.com/api'
|
DB_URL = 'https://pd.manticorum.com/api'
|
||||||
master_debug = True
|
master_debug = True
|
||||||
alt_database = 'dev'
|
alt_database = False
|
||||||
PLAYER_CACHE = {}
|
PLAYER_CACHE = {}
|
||||||
|
|
||||||
if alt_database == 'dev':
|
if alt_database == 'dev':
|
||||||
|
|||||||
@ -551,7 +551,7 @@ async def run_draft(interaction: discord.Interaction, main_team, this_event, dra
|
|||||||
view=None
|
view=None
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_embeds(include_links=True):
|
def get_embeds(include_links=True, round_num=1):
|
||||||
top_embed = helpers.get_team_embed(f'{embed_title} - Round {round_num}')
|
top_embed = helpers.get_team_embed(f'{embed_title} - Round {round_num}')
|
||||||
top_embed.description = f'Rarity Counts'
|
top_embed.description = f'Rarity Counts'
|
||||||
bot_embed = helpers.get_team_embed(f'{embed_title} - Round {round_num}')
|
bot_embed = helpers.get_team_embed(f'{embed_title} - Round {round_num}')
|
||||||
@ -619,11 +619,12 @@ async def run_draft(interaction: discord.Interaction, main_team, this_event, dra
|
|||||||
last_message = await interaction.channel.send(content=None, embeds=get_embeds(include_links=False))
|
last_message = await interaction.channel.send(content=None, embeds=get_embeds(include_links=False))
|
||||||
|
|
||||||
async def draft_loop():
|
async def draft_loop():
|
||||||
|
round_num = 1
|
||||||
|
counter = 0
|
||||||
while round_num <= 26 and counter < 50:
|
while round_num <= 26 and counter < 50:
|
||||||
counter += 1
|
counter += 1
|
||||||
params = copy.deepcopy(base_params)
|
params = copy.deepcopy(base_params)
|
||||||
logging.info(f'gauntlets.py - run_draft - event_id 5 / round_num: {round_num} / counter: {counter} '
|
logging.info(f'gauntlets.py - run_draft - event_id {this_event["id"]} / round_num: {round_num} / counter: {counter} / counts: {counts} / max_counts: {max_counts}')
|
||||||
f'/ counts: {counts} / max_counts: {max_counts}')
|
|
||||||
|
|
||||||
# Set rarity based on remaining counts
|
# Set rarity based on remaining counts
|
||||||
if counts['Hall of Fame'] < max_counts['Hall of Fame']:
|
if counts['Hall of Fame'] < max_counts['Hall of Fame']:
|
||||||
@ -772,7 +773,7 @@ async def run_draft(interaction: discord.Interaction, main_team, this_event, dra
|
|||||||
|
|
||||||
# Update roster embed
|
# Update roster embed
|
||||||
round_num += 1
|
round_num += 1
|
||||||
await last_message.edit(content=None, embeds=get_embeds(include_links=False))
|
await last_message.edit(content=None, embeds=get_embeds(include_links=False, round_num=round_num))
|
||||||
|
|
||||||
logging.info(f'going into draft')
|
logging.info(f'going into draft')
|
||||||
backyard_round = None
|
backyard_round = None
|
||||||
|
|||||||
@ -37,6 +37,7 @@ HELP_NEWGAME = (
|
|||||||
f'- Run `/new-game` and select a game mode:\n'
|
f'- Run `/new-game` and select a game mode:\n'
|
||||||
f'** **- gauntlet: Draft a team and attempt to go 10-0 against the AI teams\n'
|
f'** **- gauntlet: Draft a team and attempt to go 10-0 against the AI teams\n'
|
||||||
f'** **- mlb-campaign: Progress from Minors -> Majors -> Hall of Fame by defeating all 30 MLB teams\n'
|
f'** **- mlb-campaign: Progress from Minors -> Majors -> Hall of Fame by defeating all 30 MLB teams\n'
|
||||||
|
f'** **- exhibition: Play against the AI and choose the cardsets it uses to build a team\n'
|
||||||
f'** **- ranked/unlimited: Play against another human player\n'
|
f'** **- ranked/unlimited: Play against another human player\n'
|
||||||
f'- Set starting lineups with `/read-lineup` for each team\n\n'
|
f'- Set starting lineups with `/read-lineup` for each team\n\n'
|
||||||
f'From here, the game scorebug will be posted and you are ready to start rolling dice!'
|
f'From here, the game scorebug will be posted and you are ready to start rolling dice!'
|
||||||
@ -49,7 +50,7 @@ HELP_PLAYGAME = (
|
|||||||
f'nested commands (e.g. `/log flyball b`)\n'
|
f'nested commands (e.g. `/log flyball b`)\n'
|
||||||
f'- When you mess up a result, run `/log undo-play` and it will roll back one play\n'
|
f'- When you mess up a result, run `/log undo-play` and it will roll back one play\n'
|
||||||
f'- Run `/gamestate` to see the scorebug with both lineups\n'
|
f'- Run `/gamestate` to see the scorebug with both lineups\n'
|
||||||
f'- Run `/substitution` to make lineup changes (for you and the AI in single player)\n'
|
f'- Run `/substitution` to make lineup changes\n'
|
||||||
f'- Run `/show-card` to see upcoming batters or the current defenders'
|
f'- Run `/show-card` to see upcoming batters or the current defenders'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
14
helpers.py
14
helpers.py
@ -225,6 +225,8 @@ RARITY = {
|
|||||||
'Replacement': 0
|
'Replacement': 0
|
||||||
}
|
}
|
||||||
SELECT_CARDSET_OPTIONS = [
|
SELECT_CARDSET_OPTIONS = [
|
||||||
|
discord.SelectOption(label='1998 Live', value='20'),
|
||||||
|
discord.SelectOption(label='1998 Promos', value='21'),
|
||||||
discord.SelectOption(label='2024 Season', value='17'),
|
discord.SelectOption(label='2024 Season', value='17'),
|
||||||
discord.SelectOption(label='2024 Promos', value='18'),
|
discord.SelectOption(label='2024 Promos', value='18'),
|
||||||
discord.SelectOption(label='2023 Season', value='9'),
|
discord.SelectOption(label='2023 Season', value='9'),
|
||||||
@ -666,6 +668,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='1998 Live'),
|
||||||
discord.SelectOption(label='2024 Season'),
|
discord.SelectOption(label='2024 Season'),
|
||||||
discord.SelectOption(label='2023 Season'),
|
discord.SelectOption(label='2023 Season'),
|
||||||
discord.SelectOption(label='2022 Season'),
|
discord.SelectOption(label='2022 Season'),
|
||||||
@ -710,6 +713,8 @@ class SelectPaperdexCardset(discord.ui.Select):
|
|||||||
cardset_id = 17
|
cardset_id = 17
|
||||||
elif self.values[0] == '2024 Promos':
|
elif self.values[0] == '2024 Promos':
|
||||||
cardset_id = 18
|
cardset_id = 18
|
||||||
|
elif self.values[0] == '1998 Live':
|
||||||
|
cardset_id = 20
|
||||||
|
|
||||||
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)
|
||||||
@ -837,6 +842,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='1998 Live'),
|
||||||
discord.SelectOption(label='2024 Season'),
|
discord.SelectOption(label='2024 Season'),
|
||||||
discord.SelectOption(label='2023 Season'),
|
discord.SelectOption(label='2023 Season'),
|
||||||
discord.SelectOption(label='2022 Season'),
|
discord.SelectOption(label='2022 Season'),
|
||||||
@ -878,6 +884,8 @@ class SelectBuyPacksCardset(discord.ui.Select):
|
|||||||
cardset_id = 13
|
cardset_id = 13
|
||||||
elif self.values[0] == '2024 Season':
|
elif self.values[0] == '2024 Season':
|
||||||
cardset_id = 17
|
cardset_id = 17
|
||||||
|
elif self.values[0] == '1998 Live':
|
||||||
|
cardset_id = 20
|
||||||
|
|
||||||
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)
|
||||||
@ -2217,12 +2225,14 @@ async def roll_for_cards(all_packs: list, extra_val=None) -> list:
|
|||||||
if counts[key]['count'] > 0:
|
if counts[key]['count'] > 0:
|
||||||
params = [
|
params = [
|
||||||
('min_rarity', counts[key]['rarity']), ('max_rarity', counts[key]['rarity']),
|
('min_rarity', counts[key]['rarity']), ('max_rarity', counts[key]['rarity']),
|
||||||
('limit', counts[key]['count']), ('in_packs', True)
|
('limit', counts[key]['count'])
|
||||||
]
|
]
|
||||||
if all_packs[0]['pack_team'] is not None:
|
if all_packs[0]['pack_team'] is not None:
|
||||||
params.append(('franchise', all_packs[0]['pack_team']['lname']))
|
params.extend([('franchise', all_packs[0]['pack_team']['lname']), ('in_packs', True)])
|
||||||
elif all_packs[0]['pack_cardset'] is not None:
|
elif all_packs[0]['pack_cardset'] is not None:
|
||||||
params.append(('cardset_id', all_packs[0]['pack_cardset']['id']))
|
params.append(('cardset_id', all_packs[0]['pack_cardset']['id']))
|
||||||
|
else:
|
||||||
|
params.append(('in_packs', True))
|
||||||
|
|
||||||
pl = await db_get('players/random', params=params)
|
pl = await db_get('players/random', params=params)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user