cgrok / clashroyale

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

Error in Field Filtering #23

Closed ManinderAngural closed 6 years ago

ManinderAngural commented 6 years ago

The error occurs in the get_player(*tags: crtag, **params: keys) method which fails to filter specified fields.

Here's the code

@commands.cooldown(2,5,commands.BucketType.user)
@commands.command(name="test")
    async def _test(self, ctx, *, tag=None):
        async with ctx.typing():
            if tag is None:
                return
            try:
                player = await self.client.get_player(tag, keys = ["name","trophies"])
            except ValueError as f:
                return await ctx.send(f)
            else:
                print(player)

Expected Result

The player object with the filtered fields, name and trophies.

Actual Result

The player object with all the stats in it.

fourjr commented 6 years ago

API Issue, RoyaleAPI/cr-api#395