mirror of
https://github.com/onyx-and-iris/streamlabs-socketio-py
synced 2026-04-01 11:19:10 +00:00
update README
This commit is contained in:
parent
efde969527
commit
d6a26fda34
13
README.md
13
README.md
@ -41,23 +41,28 @@ def main():
|
||||
client.obs.on('twitch_account', on_twitch_event)
|
||||
|
||||
# run for 30 seconds then disconnect client from server
|
||||
client.sio.sleep(30)
|
||||
client.wait(30)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
```
|
||||
|
||||
> note: From the [SocketIO docs](https://python-socketio.readthedocs.io/en/latest/client.html#managing-background-tasks), `client.sio.wait()` may be used if your application has nothing to do in the main thread.
|
||||
|
||||
### Client class
|
||||
*`streamlabsio.connect(*, token: str, raw: bool = False)`*
|
||||
*`streamlabsio.connect(*, token: str, raw: bool = False) -> Client`*
|
||||
|
||||
The following keyword arguments may be passed:
|
||||
|
||||
- token: Streamlabs SocketIO api token.
|
||||
- raw: Receive raw data messages as json objects.
|
||||
|
||||
#### methods
|
||||
|
||||
*wait(self, seconds: float | None = None) -> None*
|
||||
|
||||
- float: Time in seconds to block the main thread
|
||||
- If None, the method will block indefinitely.
|
||||
|
||||
### Event Data Attributes
|
||||
|
||||
For event data you may inspect the available attributes using `attrs()`.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user