PennyDreadfulMTG / Penny-Dreadful-Tools

A suite of tools for the Penny Dreadful MTGO community
https://pennydreadfulmagic.com
MIT License
40 stars 28 forks source link

/scry border:gold usd<1 says "no matches" when there are 286 #9586

Open vorpal-buildbot opened 2 years ago

vorpal-buildbot commented 2 years ago

/scry border:gold usd<1 says "no matches" when there are 286

Reported on Discord by Wizzerinus#5217

bakert commented 2 years ago

I think we just don't allow border:gold

Wizzerinus commented 2 years ago

so does that mean /scry is implemented on the PDM's side, and doesnt use scryfall? that's kinda misleading

bakert commented 2 years ago

No, it calls Scryfall but then we take the result and do a lookup in our oracle.cards_by_name which doesn't have gold-bordered cards in it. Or something. Maybe.

Code is:

@slash_command('scry')
@slash_option('query', 'A scryfall query', OptionTypes.STRING, required=True)
async def search(ctx: MtgContext, query: str) -> None:
    """Card search using Scryfall."""
    how_many, cardnames = fetcher.search_scryfall(query)
    cbn = oracle.cards_by_name()
    cards = [cbn[name] for name in cardnames if cbn.get(name) is not None]
    await ctx.post_cards(cards, ctx.author, more_results_link(query, how_many))
bakert commented 2 years ago

(Personally I wish this command was called search not scry if we're no longer going to have aliases.)

silasary commented 2 years ago

I went off the alias people used more

silasary commented 2 years ago

Feel free to tell the majority of people that they're wrong, if you feel strongly enough :P

bakert commented 2 years ago

I'm prepared to defer to the majority if that's how you did it :)