Skip to main content

An asynchronous Python IRC and API wrapper for Twitch.

Project description

https://raw.githubusercontent.com/TwitchIO/TwitchIO/master/logo.png https://img.shields.io/badge/Python-3.7%20%7C%203.8%20%7C%203.9-blue.svg https://img.shields.io/github/license/TwitchIO/TwitchIO.svg https://img.shields.io/badge/code%20style-black-000000.svg PyPI - Downloads

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.

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:

SnowyLuma

Harmon

Tom

Tesence

Adure

Scragly

Chillymosh

If I have forgotten anyone please let me know <3: EvieePy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twitchio-2.4.0.tar.gz (91.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twitchio-2.4.0-py3-none-any.whl (120.1 kB view details)

Uploaded Python 3

File details

Details for the file twitchio-2.4.0.tar.gz.

File metadata

  • Download URL: twitchio-2.4.0.tar.gz
  • Upload date:
  • Size: 91.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for twitchio-2.4.0.tar.gz
Algorithm Hash digest
SHA256 c5be40008686705bb2470366c9e268da7b172f5ce13fd311266a369876bd40d3
MD5 abf5d14cba825d2a69b363733636e044
BLAKE2b-256 dda1fd8eb08653614c43dd3cf723ff32b1f502927c235250e07e2b46cb8ab75f

See more details on using hashes here.

File details

Details for the file twitchio-2.4.0-py3-none-any.whl.

File metadata

  • Download URL: twitchio-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 120.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for twitchio-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b0d62794b8320e5a8d11091ed3441217f7933b72720309b6e2c99f080c8a4af
MD5 3b1ba60221ba46fe506349aac6fbe3b6
BLAKE2b-256 58bbc00ff1518ce965352a75e1def6ac8f68ea9c898c8d457a597734e8fc46b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page