Twitch-Python icon indicating copy to clipboard operation
Twitch-Python copied to clipboard

It's working well.

Open nixinator opened this issue 3 years ago • 2 comments

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.

nixinator avatar Mar 09 '21 01:03 nixinator

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 ?

nixinator avatar Mar 09 '21 21:03 nixinator

try this lambda

lambda message: print(message.channel, message.sender, message.text)

this is how a "message" looks like image

DooMMasteR avatar Jul 06 '22 08:07 DooMMasteR