A program that translates Twitch chat messages from a specific user into another language.
It uses OpenAI for translation and tmi.js to connect to the Twitch API.
The program loads contextual information from the markdown file located at context/translate.md.
API keys and configuration are managed through a .env
file. The following variables are required:
# Twitch API credentials & other configurations
TWITCH_CLIENT_ID="your_client_id_here"
TWITCH_CLIENT_SECRET="your_client_secret_here"
TWITCH_BOT_USERNAME="your_bot_username_here"
TWITCH_LISTENING_CHANNEL="your_channel_here"
TWITCH_TARGET_USERNAME="target_username_here"
TWITCH_REDIRECT_URI="http://localhost:3000/callback"
# OpenAI API credentials
OPENAI_BASE_URL="your_base_API_url_here"
OPENAI_API_KEY="your_deepseek_api_key_here"
bun install
bun run index.ts
Simple health check:
# on twitch chat
ඞඞ
pm2 start ecosystem.config.js
Stop:
pm2 stop ecosystem.config.js
pm2 logs
To view only the bot's logs:
# Live monitoring (only messages from the target user and translated messages)
tail -f twitch-bot.log
# One-time output
cat twitch-bot.log
Made by Hina Lover 💕