diff --git a/bot/discord/spellbook_discord.py b/bot/discord/spellbook_discord.py index 29058ed4..a32b2eed 100644 --- a/bot/discord/spellbook_discord.py +++ b/bot/discord/spellbook_discord.py @@ -35,6 +35,7 @@ administration_users = [int(user) for user in (os.getenv(f'KUBE_ADMIN_USER__{i}', os.getenv(f'ADMIN_USER__{i}')) for i in range(10)) if user is not None] MAX_SEARCH_RESULTS = 7 +ORDERING = '-popularity,identity_count,card_count,-created' @bot.command(hidden=True) @@ -111,7 +112,7 @@ def add_kwargs(i: int, c: str): result = await api.variants_list( q=query_info.patched_query, limit=MAX_SEARCH_RESULTS, - ordering='-popularity', + ordering=ORDERING, ) result_count: int = result.count results: list[Variant] = result.results @@ -235,9 +236,9 @@ async def handle_find_my_combos(interaction: discord.Interaction, deck: DeckRequ async with API() as api_client: api = FindMyCombosApi(api_client) if isinstance(deck, str): - result = await find_my_combos_create_plain(api, deck) + result = await find_my_combos_create_plain(api, deck, ordering=ORDERING) else: - result = await api.find_my_combos_create(deck_request=deck) + result = await api.find_my_combos_create(deck_request=deck, ordering=ORDERING) results_identity: str = result.results.identity # type: ignore reply = f'## Find My Combos results for your deck\n### Deck identity: {convert_mana_identity_to_emoji(results_identity)}\n' results_included: list[Variant] = result.results.included diff --git a/client/python/spellbook_client/extensions.py b/client/python/spellbook_client/extensions.py index f103f5cb..b4eead59 100644 --- a/client/python/spellbook_client/extensions.py +++ b/client/python/spellbook_client/extensions.py @@ -10,6 +10,9 @@ async def find_my_combos_create_plain( decklist: str, limit: Optional[StrictInt] = None, offset: Optional[StrictInt] = None, + group_by_combo: Optional[bool] = None, + q: Optional[StrictStr] = None, + ordering: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -27,6 +30,9 @@ async def find_my_combos_create_plain( deck_request=decklist, limit=limit, offset=offset, + group_by_combo=group_by_combo, + q=q, + ordering=ordering, _request_auth=_request_auth, _content_type=_content_type or 'text/plain', _headers=_headers,