Skip to content

feat: add Telegram bot for watch alerts with /check and /watch commands (Fixes #26)#37

Closed
lb1192176991-lab wants to merge 1 commit into
codegraphtheory:mainfrom
lb1192176991-lab:feat/telegram-bot-26
Closed

feat: add Telegram bot for watch alerts with /check and /watch commands (Fixes #26)#37
lb1192176991-lab wants to merge 1 commit into
codegraphtheory:mainfrom
lb1192176991-lab:feat/telegram-bot-26

Conversation

@lb1192176991-lab

Copy link
Copy Markdown
Contributor

What

Adds a standalone Telegram bot (scripts/telegram_bot.py) that wraps solana-rug watch functionality. Users send mint addresses to the bot and get back safety reports. Optional monitoring pushes alerts when scores drop.

Why

Telegram is where the Solana degens live. A bot that answers "is this token safe?" in under 3 seconds is the highest-impact distribution channel.

Features

Commands

  • /check <MINT> — Get formatted safety report (score, risk, factors, market data, warnings)
  • /watch <MINT> — Start monitoring a token (persists in SQLite, same DB as CLI watch mode)
  • /unwatch <MINT> — Stop monitoring
  • /watches — List your watched tokens

Alerting

  • Background thread checks all watched tokens every 5 minutes
  • Alerts when score drops >= 10 points: "Score dropped: 85 → 60 (25 pts)"
  • Shares SQLite database with CLI watch mode — mix CLI and Telegram monitoring

Infrastructure

  • Rate limiting: max 1 check per 5 seconds per user
  • Report formatting respects Telegram's 4096 char limit
  • Markdown formatting for clean mobile rendering
  • Dockerfile for easy deployment
  • TELEGRAM_BOT_TOKEN env var (from @Botfather)

Test coverage

  • Rate limiter: first request allowed, rapid repeat blocked, different users independent
  • Report formatting: score/risk displayed correctly, market data parsed
  • Watch DB: add/get/remove operations, persistence, primary key constraints
  • Mocked tests — no real bot token needed

Example

/check DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263

*🛡️ BONK Safety Report*
Score: 100/100 — LOW
*Score Factors:*
  ✅ Mint: 0/10
  ✅ Liquidity: 0/10
  ✅ Holders: 0/10

Fixes: #26

@codegraphtheory

Copy link
Copy Markdown
Owner

Superseded by the merged PR #47. Same feature, re-applied on latest main. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram bot for watch alerts

2 participants