joshuaskelly / twitch-observer

Turn Twitch chatter into Python events
MIT License
26 stars 6 forks source link

Adding decorator for event handlers #57

Closed PythooonUser closed 6 years ago

PythooonUser commented 6 years ago

Summary

As requested by #56 this PR adds decorator support for event handlers.

Usage:

>>> @observer.on_event(ChatEventType.TWITCHCHATJOIN)
>>> def handle_join_event(event):
>>>     print(event.nickname + " joined")
PythooonUser commented 6 years ago

Of course I need to add proper testing.

joshuaskelly commented 6 years ago

Okay. I will wait on my review until the tests are in.

PythooonUser commented 6 years ago

@joshuaskelly I added a test case. Please review and decide if this is sufficient.

PythooonUser commented 6 years ago

🎉