An asynchronous Python IRC and API wrapper for Twitch.
Project description
TwitchIO is an asynchronous Python wrapper around the Twitch API and IRC, with a powerful command extension for creating Twitch Chat Bots. TwitchIO covers almost all of the new Twitch API and features support for commands, PubSub, Webhooks, and EventSub.
Documentation
For the Official Documentation: Click Here!
Support
For support using TwitchIO, please join the official support server on Discord.
Installation
TwitchIO requires Python 3.7+. You can download the latest version of Python here.
Windows
py -m pip install -U twitchio
Linux
python -m pip install -U twitchio
Access Tokens
Visit Token Generator for a simple way to generate tokens for use with TwitchIO.
Getting Started
A simple Chat Bot.
from twitchio.ext import commands
class Bot(commands.Bot):
def __init__(self):
# Initialise our Bot with our access token, prefix and a list of channels to join on boot...
super().__init__(token='ACCESS_TOKEN', prefix='?', initial_channels=['...'])
async def event_ready(self):
# We are logged in and ready to chat and use commands...
print(f'Logged in as | {self.nick}')
print(f'User id is | {self.user_id}')
@commands.command()
async def hello(self, ctx: commands.Context):
# Send a hello back!
await ctx.send(f'Hello {ctx.author.name}!')
bot = Bot()
bot.run()
Contributing
TwitchIO currently uses the Black formatter to enforce sensible style formatting.
Before creating a Pull Request it is encouraged you install and run black on your code.
The Line Length limit for TwitchIO is 120.
For installation and usage of Black visit: Black Formatter
For integrating Black into your IDE visit: Black IDE Usage
Special Thanks
Thank you to all those who contribute and help TwitchIO grow.
Special thanks to:
If I have forgotten anyone please let me know <3: EvieePy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file twitchio-2.10.0.tar.gz
.
File metadata
- Download URL: twitchio-2.10.0.tar.gz
- Upload date:
- Size: 114.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ae5e17b3764eff24ad7d12decb473c9d34f18510b5d705e0bbe6fcf0b06fd75 |
|
MD5 | a0fd2a417099443f111fe31263cfa271 |
|
BLAKE2b-256 | de613f177d7e48af2816bd7bc639a7d5c4f2fa0ff3ae46faf36754b3c3676de9 |
File details
Details for the file twitchio-2.10.0-py3-none-any.whl
.
File metadata
- Download URL: twitchio-2.10.0-py3-none-any.whl
- Upload date:
- Size: 143.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7aa0b6950dad90feeb04b03fd10d3e4292fa8a7c2e7aea6b2fd6686bc5425fb2 |
|
MD5 | bdfb91c425dff90681014f4f78e48448 |
|
BLAKE2b-256 | 4bbe49d93b0e13dad69a636e550a7b96a5208af9a91100f9b142a363882e0c4c |