Twitch-Python
Twitch-Python copied to clipboard
It's working well.
Library seems to work well,
I'm piecing it together by groking the source.
Subscribe doesn't seem to be threaded, and just blocks, is there a call back function, or is the library just designed for very simple interactions with the twitch irc servers?
twitch.Chat(channel='#sodapoppin', nickname='zarlach', oauth='oauth:xxxxxx').subscribe(
lambda message: print(message.channel, message.user.display_name, message.text))
This blocks... but it quite possible this is by design.
Okay, i worked out the call back.
However, the examples bot given in the wiki results in.
File "./new.py", line 9, in handle_message message.chat.send(f'@{message.user().display_name}, you have {message.user().view_count} views.') TypeError: 'User' object is not callable
hmmm, maybe something has changed ?
try this lambda
lambda message: print(message.channel, message.sender, message.text)
this is how a "message" looks like