Skip to content

Comdriver/skys.py

Repository files navigation

SkyS.py — Twitch-Telegram Notifier Bot

Requirements

  • Python 3.11+ (recommended)
  • A Twitch Developer application (Client ID / Client Secret)
  • A Telegram bot token
  • A Telegram chat/channel ID to post into

Installation

Clone the repo and prepare environment

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

Configuration

# Make a copy of .env file
cp .env.example .env

Edit .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.json

TO DO: add instructions on obtaining tokens

Running

python skys.py

Running as a service (Linux systemd)

Create /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.target

Enable and start:

sudo systemctl daemon-reload
sudo systemctl enable --now skyspy
sudo systemctl status skyspy

About

Twitch monitoring bot for Telegram

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages