joshuaskelly / twitch-observer

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

Adding __str__ method to TwitchChatEvent #45

Closed PythooonUser closed 7 years ago

PythooonUser commented 7 years ago

Summary

This adds the __str__ magic method to the TwitchChatEvent class to make debugging easier by simply calling:


for event in observer.get_events():
    print(event)

Which will print type:channel:nickname:mode:message:tags.

Note: This might fail in the Windows console with a UnicodeEncodeError if message contains non-printable characters.