Skip to content

Repository files navigation

TimeEnjoyed Twitch Bot 🤖🎮

A custom Twitch chatbot built in Python for the TimeEnjoyed channel.

✨ Features

  • 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).

🛠️ Technology Stack

  • Language: Python 3.10
  • Data/Web: WebSockets, HTML, CSS, JSON
  • Hardware Interfacing: PyBluez (Bluetooth)
  • Environment Management: Pipenv (Pipfile) / pip

📦 Prerequisites

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)

🚀 Installation & Setup

  1. Clone the repository:
   git clone https://github.com/ezstarr/TimeEnjoyed_Twitch_Bot.git
   cd TimeEnjoyed_Twitch_Bot
  1. Set up the virtual environment: You can either use the provided Pipfile with Pipenv:
pipenv install

Or 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)

  1. Configure Environment Variables:
  • Create a .env file in the root directory.
  • Add your Twitch credentials (TMI token, Client ID, Bot Nickname, and Initial Channels).
  1. 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).

💻 Usage

To start the bot, run the included batch script:

./run.bat

Alternatively, run the main Python script directly:

python main.py

📂 Project Structure

TimeEnjoyed_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
└── ...

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

📝 License

This project is for personal / stream use. Please reach out before redistributing or using custom assets for your own stream.

About

In Progress: Twitch bot for TimeEnjoyed using Python

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages