A custom Twitch chatbot built in Python for the TimeEnjoyed channel.
- Interactive Chat Commands: Custom commands to engage viewers, including a fun Tarot Card reading/rating feature (
tarot_ratings.py). - Real-time OBS Overlays: Uses WebSockets (
websocket.py,serverwebsocket/) to dynamically push chat interactions and visual updates directly to custom HTML/CSS OBS browser sources (overlay.html). - Data Tracking & Database: Tracks command usage and viewer interactions with a built-in SQLite/Python database (
count_database.py,command_count_table.py). - Speech Recognition: Integrated speech recognition capabilities (
sp_recog.py) to trigger actions or interact with the stream hands-free. - Hardware Integration: Connects to physical Bluetooth devices (like a receipt/thermal printer) using PyBluez to print chat events in real-time (
printer_reqs.txt).
- Language: Python 3.10
- Data/Web: WebSockets, HTML, CSS, JSON
- Hardware Interfacing:
PyBluez(Bluetooth) - Environment Management:
Pipenv(Pipfile) /pip
Before running the bot, ensure you have the following installed:
- Python 3.10+
- OBS Studio (for overlay integration)
- A Twitch Developer Application (for your Client ID and OAuth tokens)
- A C++ Build Environment (required to build certain packages like PyBluez on Windows)
- Clone the repository:
git clone https://github.com/ezstarr/TimeEnjoyed_Twitch_Bot.git
cd TimeEnjoyed_Twitch_Bot- Set up the virtual environment:
You can either use the provided
Pipfilewith Pipenv:
pipenv installOr install dependencies manually via the requirements files:
pip install -r requirements.txt
pip install -r printer_reqs.txt(Note: If you are on Windows and having trouble with the Bluetooth printer library, install the provided wheel file directly: pip install PyBluez-0.30-cp310-cp310-win_amd64.whl)
- Configure Environment Variables:
- Create a
.envfile in the root directory. - Add your Twitch credentials (TMI token, Client ID, Bot Nickname, and Initial Channels).
- Add the OBS Overlay:
- Open OBS Studio.
- Add a new Browser Source.
- Point it to the local overlay.html file in the repository (or host it locally).
To start the bot, run the included batch script:
./run.batAlternatively, run the main Python script directly:
python main.pyTimeEnjoyed_Twitch_Bot/
├── OBS/ # OBS specific assets/scripts
├── data/ # Local data storage for the bot
├── plugins/ # Modular plugin files for extending bot features
├── serverwebsocket/ # Backend websocket server handling
├── main.py # Main entry point for the Twitch bot
├── count_database.py # Database logic for tracking interactions
├── websocket.py # Websocket connections to the front-end overlay
├── overlay.html # The custom OBS Browser Source layout
├── sp_recog.py # Speech recognition module
├── tarot_ratings.py # Tarot rating command logic
└── ...
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is for personal / stream use. Please reach out before redistributing or using custom assets for your own stream.