mathsman5133 / coc.py

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

Hero.required_th_level False Documentation #197

Closed MasterNoob34 closed 1 year ago

MasterNoob34 commented 1 year ago

The output is documented as int but it actually returns UnitStatList.

Code

hero = client.get_hero(hero_name)
if hero.required_th_level <= min_townhall:
   # do something
Screen Shot 2023-05-18 at 13 07 22

Error

TypeError: '<=' not supported between instances of 'UnitStatList' and 'int'
doluk commented 1 year ago

Can you post your code snippet here please?

MasterNoob34 commented 1 year ago

Can you post your code snippet here please?

Sorry, posted them now!

doluk commented 1 year ago

yeah, you just got the hero without a level. You need to get the hero for a level, then the return value should be an int

MasterNoob34 commented 1 year ago

Ok thank you, didn't know. I thought it was return int.