Giter VIP home page Giter VIP logo

Comments (4)

raineorshine avatar raineorshine commented on June 1, 2024

from mtg-sdk-javascript.

Arc676 avatar Arc676 commented on June 1, 2024

I've tried running a query outside of the Discord bot:

const mtg = require('mtgsdk')
mtg.card.where({type:'instant', manaCost:'{X}{2}{U}'}).then(cards => {
	console.log(cards.length + " cards found")
	console.log(cards[0])
})

And I get this output

100 cards found
{ name: 'AWOL',
  manaCost: '{2}{W}',
  cmc: 3,
  colors: [ 'White' ],
  colorIdentity: [ 'W' ],
  type: 'Instant',
  types: [ 'Instant' ],
  rarity: 'Common',
  set: 'UNH',
  setName: 'Unhinged',
  text: 'Remove target attacking creature from the game. Then remove it from the removed-from-game zone and put it into the absolutely-removed-from-the-freaking-game-forever zone.',
  artist: 'Stephen Tappin',
  number: '2',
  layout: 'normal',
  multiverseid: 74231,
  imageUrl: 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=74231&type=card',
  foreignNames: 
   [ { name: 'Absent sans permission',
       imageUrl: 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=97277&type=card',
       language: 'French',
       multiverseid: 97277 } ],
  printings: [ 'UNH' ],
  originalText: 'Remove target attacking creature from the game. Then remove it from the removed-from-game zone and put it into the absolutely-removed-from-the-freaking-game-forever zone.',
  originalType: 'Instant',
  legalities: [ { format: 'Un-Sets', legality: 'Legal' } ],
  id: 'b693bb185ff34b833442bfd1822192e9fc53d306' }

from mtg-sdk-javascript.

Arc676 avatar Arc676 commented on June 1, 2024

OK I just went back to the API site. This is an API issue, not an SDK issue (i.e. the API itself doesn't allow searching for mana cost, it's not a problem with this project).

This quote from the above link:

The fields below are also part of the response (if not null), but cannot currently be used as query parameters

The fields that cannot be used in queries include manaCost. Not sure how you want to handle this, so I'll leave the issue open for now. Feel free to close it if you wish.

from mtg-sdk-javascript.

raineorshine avatar raineorshine commented on June 1, 2024

Aha! Thanks for figuring this out. If the API doesn't support it, this library won't be able to support it. I would suggest putting in a ticket with magicthegathering.io for this as a requested feature!

from mtg-sdk-javascript.

Related Issues (14)

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.