Comments (4)
from mtg-sdk-javascript.
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.
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.
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)
- Return more than 100 results? HOT 1
- Issue in react-native app HOT 2
- use of sdk ambiguous in documentation
- Error on load mtgsdk HOT 1
- Add ES6 module support HOT 3
- Add support for supertypes, subtypes and types HOT 1
- How to Contribute? HOT 6
- mtg.card.where overwrites the page property with 0 HOT 1
- Question: Can I query multiple CMCs? HOT 3
- Search query for card names with "Aether" always return an empty result. HOT 4
- TransformError: Couldn't find preset "es2015" HOT 4
- Helper function for getting a card's static abilities HOT 3
- Babel doesn't seem to play well with Angular HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mtg-sdk-javascript.