This is a simple Twitch chat bot that uses Google Text-to-Speech (TTS) to convert messages in chat to audio and plays them through the bot's audio output. Audio is routed through the default audio output.
- Connects to the Twitch IRC server using the
twitchio
library. - Uses the Google TTS API to convert messages in chat to audio content.
- Plays the audio content form chat through the bot's audio output (default oudio device) using the
pygame
library. - Responds to the
?hello
command with a greeting in chat.
To install the dependencies for this project, run the following command:
pip install -r requirements.txt
Edit a .env
file in the project directory with the following variables:
token=your_twitch_api_token
initial_channels=your_twitch_username
Once the bot is running, join your Twitch channel and start typing messages in the chat. The bot will convert your messages to speech and play the resulting audio.
You can also use the ?hello
command to test the bot's responsiveness.
This project was inspired by the Twitch channel of Prof. Andrea Pollini and the supportive Twitch community. Thanks to their encouragement and feedback, this bot was created to enhance the Twitch chat experience. Special thanks also go to the developers of Pygame and gTTS for their excellent libraries.
This project is licensed under the MIT License - see the LICENSE for details.