cgrok / clashroyale

Async + Sync wrapper for royaleapi.com and the CR official API
MIT License
47 stars 19 forks source link

Request multiple tags at once? #37

Closed astranberg closed 4 years ago

astranberg commented 4 years ago

The RoyaleAPI (unofficial) supports searching multiple tags up to 25: e.g. https://api.royaleapi.com/players/tag1,tag2,tag3 note: the official API does not

When I try this feature in your wrapper I get an error. Traceback (most recent call last): File "C:/Users/Adam/PycharmProjects/ClashRoyaleMeta/getTags.py", line 22, in <module> lClan = unofficialClient.get_clan(sClanTags) File "C:\Users\Adam\PycharmProjects\ClashRoyaleMeta\venv\lib\site-packages\clashroyale\royaleapi\utils.py", line 30, in wrapper new_args.append(converter(a)) File "C:\Users\Adam\PycharmProjects\ClashRoyaleMeta\venv\lib\site-packages\clashroyale\royaleapi\utils.py", line 83, in crtag raise ValueError('Invalid tag characters passed: {}'.format(', '.join(bad))) ValueError: Invalid tag characters passed: ,

I suspect support is just not added for it in the wrapper since only certain characters are allowed in a tag. I think this would be an easy fix.

Cheers! ~Bub

astranberg commented 4 years ago

I finally realized you can add each tag as a separate argument instead of as a comma-separates string.

:)