coc.py icon indicating copy to clipboard operation
coc.py copied to clipboard

WarEvents are not working for anything other than war_attack

Open CinematicGenius007 opened this issue 3 years ago • 5 comments

In documentation it is mentioned that you can use it for state (war) as well but it's just not working. Is it not implemented in the code?

CinematicGenius007 avatar Jan 17 '22 08:01 CinematicGenius007

Screenshot (733)

CinematicGenius007 avatar Jan 17 '22 08:01 CinematicGenius007

In documentation it is mentioned that you can use it for state (war) as well but it's just not working. Is it not implemented in the code?

Can you share your script what you tried🙂 this way we can figure out what's getting wrong

Anubhav1603 avatar Jan 17 '22 10:01 Anubhav1603

Inside in the init function of COG class self.bot.coc.add_events(self.on_war_state_change)

and the function @coc.WarEvents.state() async def on_war_state_change(self, prev_war, new_war: coc.ClanWar): print(new_war.state)

The function was just for checking it, but it wasn't working. And I checked manually the clans on coc where the state changed.

CinematicGenius007 avatar Jan 17 '22 10:01 CinematicGenius007

Inside in the init function of COG class self.bot.coc.add_events(self.on_war_state_change)

and the function @coc.WarEvents.state() async def on_war_state_change(self, prev_war, new_war: coc.ClanWar): print(new_war.state)

The function was just for checking it, but it wasn't working. And I checked manually the clans on coc where the state changed.

Sorry I cannot give any more code.

Even you could give an example of using war events other than war_attack that would be splended.

CinematicGenius007 avatar Jan 17 '22 10:01 CinematicGenius007

Sorry I cannot give any more code.

without proper code i cannot help you mate, because i dont know where are you messing things.

Even you could give an example of using war events other than war_attack that would be splended.

all the examples in example folder are tested by me and its used by many others 😃 .

Anubhav1603 avatar Feb 06 '22 07:02 Anubhav1603

Closed as no response and not reproducible

doluk avatar Jan 24 '23 22:01 doluk