Twip
Introduction
이 라이브러리는 Twip의 공식 라이브러리가 아니며, Twip에서 스트리머들에게 제공하는 Alert Box를 이용해서 도네이션, 팔로우, 호스팅 등의 이벤트에 대해서 간편하게 대응하기 위해서 만들어졌습니다.
This library is not an official library of twip. It was created to conveniently respond to events such as donation, follow, and hosting using the Alert Box provided by twip to streamers.
Installation
pip install twip-api
Examlpe
import twip
Twip = twip.Twip()
@Twip.event
def on_donate(ctx):
print(f"id : {ctx.id}")
print(f"nickname : {ctx.nickname}")
print(f"amount : {ctx.amount}")
print(f"comment : {ctx.comment}")
Twip.run("your alert box id")
More examples on github example.py
Features
- Class corresponding to each event element
- Using Websockets (Not socket.io)
- Use of decorators
Tech
Twip uses a number of open source projects to work properly:
- websocket-client- It provides access to low level APIs for WebSockets.
- requests - An elegant and simple HTTP library for Python.
- urllib - A package that collects several modules for working with URLs.
- re - regular expression matching operations.
License
MIT
Version
0.0.7 : Fixed bug that occurred when there was no sound event.