explaingit

gongyichuren/tg-watchbot

Analysis updated 2026-06-24

33PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

A single-file Python service combining a two-way Telegram customer-service bot, an RSS and web page watcher, and a FastAPI admin panel, runnable on a small VPS or home server.

Mindmap

mindmap
  root((tg-watchbot))
    Inputs
      Telegram messages
      RSS feeds
      Scraped web pages
    Outputs
      Admin forwards
      Telegram alerts
      Web inbox
    Use Cases
      Customer support bot
      Price stock watcher
      Self-hosted monitor
    Tech Stack
      Python
      aiogram
      FastAPI
      SQLite
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Run a personal Telegram customer-service bot that forwards user DMs to up to three admins

USE CASE 2

Watch RSS feeds and scrape pages with CSS selectors for keyword, price, or stock changes

USE CASE 3

Self-host the whole thing on a VPS behind a Cloudflare Tunnel for safe panel access

USE CASE 4

Manage monitors and quick replies from a FastAPI web panel on port 8765

What is it built with?

PythonaiogramFastAPISQLiteAPSchedulerBeautifulSoup

How does it compare?

gongyichuren/tg-watchbot410979729/scope-recallarahim3/mlx-dspark
Stars333333
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity3/53/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Needs a Telegram bot token plus admin chat IDs configured before the panel becomes useful, settings live in YAML edited through the panel.

In plain English

tg-watchbot is a small Python service that bundles three things into one tool: a two-way Telegram customer-service bot, a background watcher for websites and RSS feeds, and a web admin panel that ties both pieces together. It is meant to run on a personal server, a small home machine behind NAT, or a cheap VPS, with systemd or Docker keeping it alive. The whole project is a single application file driving everything. On the Telegram side, regular users talk privately to the bot, and every message is first saved to a SQLite database and then forwarded to one or more admins, up to three admin chat IDs. Admins can reply by simply replying to the forwarded message, or by using explicit commands like /reply, /sendpic, /block, /unblock, /note, and /who. There is a built-in spam filter with keyword lists, automatic blocking, and per-user rate limits. The bot uses the official Telegram Bot API, not a userbot. The monitor side checks RSS or Atom feeds and also scrapes web pages with CSS selectors, watching for keyword hits, new entries, price changes, or stock changes. Each monitor can choose to push alerts to Telegram, or only record them to the web panel's push history. The README notes a 60-second minimum interval and a built-in deduplication step so the same item is not pushed twice. The web panel runs on port 8765 with a real login page and HttpOnly session cookies rather than browser basic auth. From there an operator can add, edit, delete, and preview monitors, edit the YAML config, manage users, send proactive messages, view a full two-way inbox, set quick reply templates, import or export config.yaml, and check logs and a /health endpoint. Settings for the bot token, admin IDs, and panel account are entered through the panel itself, with a restart needed after saving. Installation is documented three ways: a Docker Compose one-liner, a manual Python virtualenv flow, and a systemd deployment with an optional Cloudflare Tunnel plus Zero Trust Access for exposing the panel safely. The project uses aiogram, FastAPI, Uvicorn, APScheduler, httpx, feedparser, BeautifulSoup, PyYAML, python-dotenv, and the standard library sqlite3 module.

Copy-paste prompts

Prompt 1
Spin up tg-watchbot with Docker Compose and walk me through pasting in a bot token and admin IDs.
Prompt 2
Add a new web monitor to tg-watchbot that watches a product page and pings me when the price drops below a threshold.
Prompt 3
Expose tg-watchbot's panel safely from my home network using Cloudflare Tunnel and Zero Trust Access.
Prompt 4
Extend tg-watchbot's spam filter with a new rule that auto-blocks any user sending more than five messages in ten seconds.

Frequently asked questions

What is tg-watchbot?

A single-file Python service combining a two-way Telegram customer-service bot, an RSS and web page watcher, and a FastAPI admin panel, runnable on a small VPS or home server.

What language is tg-watchbot written in?

Mainly Python. The stack also includes Python, aiogram, FastAPI.

How hard is tg-watchbot to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is tg-watchbot for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.