This update has quite a bit of change without breaking backward compatibility.
For starters, support for the context manager was added 121 allowing the use of
py
async def main():
async with coc.Client() as client:
do stuff...
if __name__ == "__main__":
asyncio.run(main())
Additionally, with the release of CapitalRaidSeasons we needed to improve the performance of fetching warlogs and capital raid logs. Previously, all records available from the API were fetched when in most cases, folks just needed the newest data. A `limit` parameter has been added to both `get_warlog` and `get_raidlog`.
Additionally, support for `async for warlog` has been added with the ability to fetch more data if needed.
py
raid_logs = await client.get_raidlog(clan_tag, page=True, limit=5)
Set `paginate=True` to enable fetching beyond the limit value until
there are more values to fetch
count = 0
async for i in raid_with_page:
print(f"[{count}]-async limit: 5 page: True {i.start_time.time}")
count += 1
This PR includes:
122
121
130
131