theBowja / genshin-db

npm package with searching functions for Genshin Impact data of all in-game languages. Data parsed/organized directly from GenshinData repo.
MIT License
363 stars 69 forks source link

How to get all weapons of a specific 'type'? #83

Closed phrozen closed 2 years ago

phrozen commented 2 years ago

Hey, thanks for this project, I'm writing a very simple team builder using Svelte and I don't see any example on how to get all weapons for a specific type of weapon ('swords', 'bows', 'polearms', 'greatswords'). Is there a way to get all objects for a collection like characters or weapons?

genshindb.weapons('names', { matchCategories: true}) or genshin.characters('names', { matchCategories: true })

will get me all names... but, how do I get all the objects from the collection instead? Then I can filter out just what I need and how I need it.

theBowja commented 2 years ago

You can use genshindb.weapons('sword', { matchCategories: true, verboseCategories: true })

phrozen commented 2 years ago

Thanks! That is very helpful!

Unrelated question, I'm finding a lot of broken image urls (404), what would be the best way to report them?

theBowja commented 2 years ago

Which images for example

phrozen commented 2 years ago

Like for Cinnabar Spindle, the Icon link is: https://upload-os-bbs.mihoyo.com/game_record/genshin/equip/UI_EquipIcon_Sword_Opus.png

Which results in a 404