- Python 3.11+ (recommended)
- A Twitch Developer application (Client ID / Client Secret)
- A Telegram bot token
- A Telegram chat/channel ID to post into
git clone http://git.zodcode.tech/ZODCODE/twitch-bot.git
cd twitch-bot
# Create a vitrual environment
python -m venv .venv
# Activate virtual environment
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Make a copy of .env file
cp .env.example .envEdit .env and add your: TWITCH_CLIENT_ID TWITCH_CLIENT_SECRET TELEGRAM_BOT_TOKEN MASTER_CHAT_ID # telegram chat ID for all the notifications
And at least for one streamer: STREAMER1_URL # twitch streamer URL STREAMER1_CHAT_ID # telegram chat ID for notifications for defined streamer STREAMER1_THREAD_ID # telegram chat thread ID, in case if SUPEGROUP is used
# Make a copy of twitch_user_token.json file
cp twitch_user_token.json.example twitch_user_token.jsonTO DO: add instructions on obtaining tokens
python skys.pyCreate /etc/systemd/system/skyspy.service:
[Unit]
Description=SkySpy Bot
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=system
WorkingDirectory=/home/system/twitch
ExecStart=/home/system/twitch/venv/bin/python /home/system/twitch/skys.py
Restart=always
RestartSec=5
Environment=PYTHONUNBUFFERED=1
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now skyspy
sudo systemctl status skyspy