twitchkeywords

Twitch bot that handles commands and other features through the use of custom tokens.


Keywords
twitch, keywords, bot
License
MIT
Install
pip install twitchkeywords==0.1.3.2

Documentation

Twitch Keywords Bot

A Twitch bot that handles commands and other features through the use of custom keywords.

Installation

Installing from pip:

pip install twitchkeywords --upgrade

OR

By cloning the repository:

Clone this repository

git clone https://github.com/tpreischadt/Twitch-Keywords.git

Install all dependencies (it's heavily recommended that you do this inside a virtual enviroment).

pip install -r requirements.txt

Authenticating

  1. Go to https://twitchapps.com/tmi/ and get your OAuth Password. This is linked to your logged in account, so if you're planing on using bot-like features (such as sending messages in chat), you'd probably wanna do this within a bot account.

  2. Go to the Twitch Developer Portal and register an Application to get your Client ID like so:

registration

  1. Create a .env file in the project's directory which looks like this:

env

And replace each value with your credentials.

IMPORTANT: This is all sensitive information, do not share your OAuth Password, Client ID and/or .env file.

Basic usage

Example code:

example_code

Here's a test in chat:

twitch chat

Here's what the program's log will look like. Notice how when some message invokes a coroutine, it's colored blue.

log

For more advanced usage, you could create a class extending the Keywords class, which is a child class of TwitchIO's bot class. Nonetheless, I suggest not to override the on_message method, since that's what's handling the keywords/bindings coroutines invokations.