Giter Club home page Giter Club logo

bolas's People

Contributors

accelbread avatar bmbowdish avatar jeacaveo avatar reidesplin avatar shapersavant avatar theneosloth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bolas's Issues

Improvement on !diff function

How to replicate:
!diff
Diff too long

Here's a suggested improvement. Instead of Diff too long have this output in an embed.

  url 1 title          url 2 title
29 Creatures     30 Creatures     
31 Lands         30 Lands
18 Sorceries     20 Sorceries
22 Instants      20 Instants
Which would you like to see?
!diff creature

<list the creature differences>

Card lookup failure terminates search

If any one card fails to be found, no card results are returned, as opposed to info for found cards and an error for an unfound card (preferably with the card name).

Optimize the code

The code is extremely inefficient right now. For example: in order to keep the track of the last card found the bot currently stores a full card object for every server it's connected to instead of just saving the name of the last card used.

Diff fails

This command fails
!diff https://tappedout.net/mtg-decks/rad-farm/ https://tappedout.net/mtg-decks/razaketh-adnaus-scepter\

My guess is a split card somewhere?

!Price only shows first card from previous list

If my card search results are as follows
Card 1 {1}
Card 2 {1}
Card 3 {1}
Card 4 {1}
Card 5 {1}

When the !price command is executed only the following is displayed:
9.99 -- Card 1

It would be nice if it displayed all the card prices. Maybe like so:
9.99 -- Card 1
29.07 -- Card 2
5.99 -- Card 3
0.50 -- Card 4
0.99 -- Card 5

!price function for MDFC cards

Hi again theneosloth

I hope you're doing well. We in the EDH discord still love your bot with all its great functionalities haha. :)

There seems to be an issue with the price functionality when it comes to MDFC cards (or probably multi faced cards in general). When searching for a MDFC card like "Needleverge Pathway" it returns "Price not found.". The same is true when searching for "Needleverge Pathway // Pillarverge Pathway", the way the API treats the name of double faced cards.

When looking through the code, I think this issue stems from two parts. Both in the "search_card" function that is called by the price function.

  1. One seems to be that the search function finds the name "Needleverge Pathway", but it's a "card_face" and so it returns a not found.
  2. The other seems to be for how the function parses the query to create a URL. The urllib.parse.quote function uses the '/' as a safe character as default, so I think what happens here is that the '//' in the middle is not parsed the way the API expects it, so it also can't find it as a card.

My proposal would be to find a way to return a card in the first way of searching for the DFC, and for the second situation (especially if the first can't be solved), the quote function has a second variable where you define the safe character, which you could set to something not used in the API.

Kind regards
LordBunilla

!price functionality regarding foil cards / cards with latest digital releases

Hi theneosloth

I really appreciate your work with the Bolas bot, as it works really well with queries, and allows fast searches for the cards related to terms, especially for commander brewers like me. We're using it on the r/EDH discord, and there I've noticed two things, specifically regarding the !price command:

The !price command doesn't function well for two types of cards:

  1. Cards that only exist in foil (Tymna, the Weaver) [The "usd" in the scryfall api does not contain foil prices, also not for those that only exist in foil.]
  2. Cards where the latest release is digital (The Tabernacle at Pendrell Vale) [The scryfall api grabs the digital version for some reason, no matter if you use fuzzy or search.]

For the first one, it would probably just be a matter of also displaying the "usd_foil" price. (And while we're at it, you might as well also show the "eur" price.)

For the second one, this likely needs some rework of the price functionality, but you already used similar methods for the !art command:

  • Instead of using the "named" function, use the "search" function, but add a "order:usd" in the beginning of the query (so "q=order:usd [args]"), to filter out digital cards (you would normally use "not:digital", but if someone wants to know the tix price, it wouldn't be optimal).

What happens here is the following in the possible scenarios:

  • Someone types in "Blood", you still return "too many cards match the search..."
  • Someone types in "Blood Pet", it returns the lowest USD price (usd:0.24, usd_foil:none, eur:0.09, tix:none)
  • Someone types in "Blood Pet set:7ed", it returns the price of that version
  • Someone types in "Blood Pet order:tix", it overwrites your "order=usd", as providing two times "order" in a query it just selects the last one that is in the query, thus it provides the lowest TIX price
  • Someone types in "Tymna, the Weaver", it returns the price of the foil card, and not the digital card, despite both having usd:none, the scryfall API seems to know what you want here, which is good!

Kind regards
LordBunilla

Use the Scrython library for the card search

The current implementation of the card search is not asynchronous, which I suspect is causing some bottlenecks. Instead of re-implementing the api wrapper it might be better to use the scrython library

Add persistent database support

Right now bolas contains a large number of hard coded server and user specific values that cannot be changed without updating the code. It would be better to store these values in a separate database.

Separate commands into separate files in a subdirectory

Currently all the commands are located within a single file. This was working well for when there were only a few of them but as more and more of them get added managing the file gets a little bit unwieldy.

Because all the files inherited from the CommandPlugin class are imported automatically this should be trivial to do and it would improve the readability of the code immensely.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.