mathsman5133 / coc.py

Python API Wrapper for Clash of Clans.
https://cocpy.readthedocs.io/en/latest/
MIT License
124 stars 41 forks source link

Missing ID in coc.Spells #222

Closed btimothy-har closed 10 months ago

btimothy-har commented 10 months ago

Following code:

import coc

coc_client = coc.EventsClient(
  load_game_data=coc.LoadGameData(always=True),
  key_count=1,
  key_names='coc.py'
  )
await coc_client.login([username],[password])

i = await coc_client.get_player('#LJC8V0GCJ')
print(i.spells)

returns AttributeError

AttributeError                            Traceback (most recent call last)
[<ipython-input-10-3a4e57721249>](https://localhost:8080/#) in <cell line: 13>()
     11 
     12 i = await coc_client.get_player('#LJC8V0GCJ')
---> 13 print(i.spells)

[/usr/local/lib/python3.10/dist-packages/coc/spell.py](https://localhost:8080/#) in __repr__(self)
     73         attrs = [
     74             ("name", self.name),
---> 75             ("id", self.id),
     76         ]
     77         return "<%s %s>" % (

AttributeError: 'Spell' object has no attribute 'id'
btimothy-har commented 10 months ago

Not sure if it is related, but client.get_spell also returns None on any spell name passed

lukasthaler commented 10 months ago

Probably is related, and most likely has to do with the fix I built for the army link parser. Will try to look into it, but with the holidays coming up, I can't give a precise ETA