Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's working well. #33

Open
nixinator opened this issue Mar 9, 2021 · 2 comments
Open

It's working well. #33

nixinator opened this issue Mar 9, 2021 · 2 comments

Comments

@nixinator
Copy link

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
Copy link
Author

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
Copy link

DooMMasteR commented Jul 6, 2022

try this lambda

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

this is how a "message" looks like
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants