GithubHelp home page GithubHelp logo

blackcool70 / twitchio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pythonistaguild/twitchio

0.0 1.0 0.0 498 KB

TwitchIO - An Async Bot/API wrapper for Twitch made in Python.

License: MIT License

Python 100.00%

twitchio's Introduction

https://i.imgur.com/B0nvk2w.png?raw=true

https://api.codacy.com/project/badge/Grade/61e9d573b4af415a809068333d6b437b Maintainability

An Asynchronous IRC/API Wrapper currently in Development for TwitchBots made in Python!

Documentation

Official Documentation: Click Here!

Support

For support using TwitchIO, please join the official support server on Discord.

Installation

The following commands are currently the valid ways of installing TwitchIO.

TwitchIO requires Python 3.6 or higher.

Windows

py -version -m pip install twitchio

Linux

python3 -m pip install twitchio

Getting Started

TwitchIO uses many endpoints which may require different tokens and IDs.

  1. IRC endpoints which require an OAuth token.
    To get a token, log in to Twitch with the bot's account and visit: https://twitchapps.com/tmi/
  2. HTTP endpoints which require a client ID.
    To be documented.
  3. HTTP endpoints which require an OAuth token and certain scopes.
    To be documented.

All 3 endpoints may be used at the same time. Otherwise, you may choose to use any or some of the endpoints.

Currently, TwitchIO's development is at a phase which has emphasis on the IRC endpoint and creating a framework around it. Once this is implemented, the other 2 endpoints will be developed further.

A quick and easy bot example:

from twitchio.ext import commands


class Bot(commands.Bot):

    def __init__(self):
        super().__init__(irc_token='...', client_id='...', nick='...', prefix='!',
                         initial_channels=['...'])

    # Events don't need decorators when subclassed
    async def event_ready(self):
        print(f'Ready | {self.nick}')

    async def event_message(self, message):
        print(message.content)
        await self.handle_commands(message)

    # Commands use a different decorator
    @commands.command(name='test')
    async def my_command(self, ctx):
        await ctx.send(f'Hello {ctx.author.name}!')


bot = Bot()
bot.run()

Become a patron and help support TwitchIO's development <3.

All Twitch logos used are owned by Twitch.tv respectively. Use of the Twitch logos does not imply any affiliation with or endorsement by them.

twitchio's People

Contributors

evieepy avatar lostluma avatar harmon758 avatar tesence avatar musiconline avatar nihaals avatar jteague9 avatar adure avatar imgbotapp avatar scragly avatar zax-xyz avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.