Skip to content

A twitch bot that handles keystrokes using my Twitch Keywords module

License

Notifications You must be signed in to change notification settings

tprei/Twitch-Keyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twitch Keyboard

A twitch bot that handles keystrokes using the twitchkeywords module

Installation

Clone this repository

git clone https://github.com/tpreischadt/Twitch-Keyboard.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 configuration

To configure your commands, simply edit the config.json file, which looks like this:

config.json

In the controls part, you can map certain commands to keystrokes, in this case, if a user sends the following message in chat:

!up 10 down 3 up 5

Then the bot will trigger the following keystrokes: wwwwwwwwwwssswwwww, which is "w" (10 times) "s" (3 times) "w" (5 times)

In the options part, you can determine the delay between keystrokes and the maximum amount of times a keystroke can be pressed.

Running the bot

To run the bot, simply use python, like so, but remember that you must have sudo powers in Linux (because of the keyboard module):

python bot.py

Note: If you're inside a virtual environment, run which python to see what your path to python is and use sudo to run that.

About

A twitch bot that handles keystrokes using my Twitch Keywords module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages