PetterKraabol / Twitch-Python

Object-oriented Twitch API for Python developers
https://pypi.org/project/twitch-python
MIT License
214 stars 37 forks source link

It's working well. #33

Open nixinator opened 3 years ago

nixinator commented 3 years ago

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 commented 3 years ago

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 ?

DooMMasteR commented 2 years ago

try this lambda

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

this is how a "message" looks like image