aiotw is a small, asynchronous library for working with Twitch.
Warning
PROJECT STILL UNDER DEVELOPMENT! We do not recommend using this project in production BEFORE v1.0! Any update can broke previous functionallity!
- IRC
- Helix
- EventSub.
- Python >= 3.11
Install
pip install aiotwSimple client example
import asyncio
from aiotw import irc
client = irc.Client(auth_token='oauth:...', auth_nickname='mybot')
# or you can use anonymous client
client = irc.create_anonymous_client()
@client.on(irc.PrivmsgMessage)
async def on_privmsg(msg: irc.PrivmsgMessage):
print(f'[{msg.channel}] <{msg.user}>: {msg.message}')
# send privmsg will not work if you use anonymous client!
if not client.is_anonymous:
await client.send(irc.PrivmsgMessage(channel=msg.channel, message=msg.message))
async def main():
async with client:
await client.send(irc.JoinMessage(channel='some_channel'))
await client.serve()
asyncio.run(main())See irc sources for details.
Not implemented yet.
Not implemented yet.
This project is released under the MIT License — see the LICENSE file for the full text.