A scheduled Telegram bot that pushes Vietnamese market data and developer trends to a channel — gold prices, Bitcoin, stocks, and GitHub trending repos. Each data source runs on its own cron schedule via GitHub Actions, so no server is required.
- 📈 Vietnamese stock prices — VN-Index, VN30, and configurable tickers (via vnstock)
- 🏆 Gold prices — SJC and Kim Long Đồng Tháp jewelry
- ₿ Bitcoin — BTC/USD with 24h change (via CoinGecko)
- 🔥 GitHub Trending — top repos with clickable links
- ⚙️ Plugin architecture — add new sources by implementing a simple 2-method interface
- 🕐 Zero-ops scheduling — runs entirely on GitHub Actions cron
- 🎨 Beautiful messages — HTML formatting with emojis, no link-preview clutter
📈 Giá cổ phiếu Việt Nam
🏛 Chỉ số thị trường
• VN-Index: 1,819.83 📈 +1.07%
• VN30: 1,979.19 📈 +0.90%
💹 Cổ phiếu
• VNM: 61,100 VNĐ 📉 -0.33%
• HPG: 26,500 VNĐ 📈 +1.85%
🔗 Nguồn: vnstocks
| Source | What it sends | Default schedule (VN time) |
|---|---|---|
gold-price |
SJC gold buy/sell prices | 8:00 AM daily |
kimlong-gold-price |
Kim Long Đồng Tháp jewelry prices | 8:10 AM daily |
bitcoin-price |
BTC/USD price + 24h change | 8:05 AM daily |
stock-price |
VN-Index, VN30, + configurable tickers | 9:00 AM Mon–Fri |
github-trending |
Top trending GitHub repositories | 9:00 AM daily |
1. Fork this repo (or use it as a template).
2. Create a Telegram bot via @BotFather, then add it as admin to your channel.
3. Add repository secrets — Settings → Secrets and variables → Actions:
TELEGRAM_BOT_TOKEN— your bot tokenTELEGRAM_CHANNEL_ID—@mychannelor numeric chat ID (e.g.-1001234567890)
4. Customize sources.example.yaml (copy to sources.yaml for local use; GitHub Actions falls back to the example).
5. Trigger manually — go to Actions tab → pick a workflow → Run workflow. Or wait for the cron.
That's it! No server, no Docker, no money spent.
# Clone and install
git clone https://github.com/alanzng/news-bot-say-hi.git
cd news-bot-say-hi
pip install -r requirements.txt
# Configure
cp sources.example.yaml sources.yaml
cp .env.example .env
# edit .env with your bot token + channel ID
# Run all sources on schedule (long-running process)
make run
# Run a single source once (useful for debugging)
python -m src.cli --source gold-price
# Run tests
make test
# Lint
make lintsources.yaml (or sources.example.yaml as a fallback) controls enabled sources and their options:
sources:
stock-price:
enabled: true
schedule: "0 9 * * 1-5" # cron (local mode only; GitHub Actions uses .github/workflows/)
tickers:
- HPG # Hoa Phat Group
- MBB # MB Bank
- SSI # SSI Securities
github-trending:
enabled: true
language: "" # empty = all languages; or "python", "rust", etc.
since: "daily" # daily | weekly | monthly
limit: 5Set enabled: false to disable any source.
| Variable | Required | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN |
✅ | Bot token from @BotFather |
TELEGRAM_CHANNEL_ID |
✅ | Channel username (@mychannel) or numeric chat ID |
RUN_ON_STARTUP |
❌ | true to fire all sources immediately on start (local mode) |
src/
├── base.py # DataSource abstract base class
├── cli.py # Single-source runner (used by GitHub Actions)
├── main.py # APScheduler long-running process (local mode)
├── config.py # Loads sources.yaml + env secrets
├── notifier.py # Telegram Bot API wrapper
├── registry.py # Wires sources to schedules
└── sources/
├── gold_price.py
├── kimlong_gold_price.py
├── bitcoin_price.py
├── stock_price.py
└── github_trending.py
.github/workflows/ # One cron workflow per source + CI
tests/ # pytest suite mirroring src/
-
Create
src/sources/my_source.pyextendingDataSource:from src.base import DataSource class MySource(DataSource): name = "my-source" default_schedule = "0 9 * * *" def fetch(self) -> list[dict]: # return records or [] on soft failure ... def format(self, records: list[dict]) -> str: # return HTML Telegram message, or "" to skip sending ...
-
Register in
src/registry.py. -
Add a block in
sources.example.yaml. -
Copy an existing
.github/workflows/*.ymland update the--sourcearg + cron. -
Add tests at
tests/sources/test_my_source.py.
See AGENTS.md for the full contributor playbook.
Contributions welcome! See CONTRIBUTING.md for the workflow, coding conventions, and PR checklist. For AI-assisted contributions (Claude Code, Cursor, etc.), see AGENTS.md.
MIT © Alan Ng
- vnstock — Vietnamese stock market data
- SJC, Kim Long Đồng Tháp — gold price data
- CoinGecko — crypto prices
- CafeF — market index data