A real-time monitoring bot that watches selected X accounts and mirrors their activity into Telegram. It tracks new follows, community joins, tweets, replies, and Telegram channel/group joins, then sends instant alerts straight to your chat so you never miss a move.
Designed for social monitoring, growth tracking, and low-latency account stalking-style alerts across X and Telegram.
Created by Bitbash, built to showcase our approach to Scraping and Automation!
If you are looking for x-telegram-python-account-activity-tracker-bot you've just found your team — Let’s Chat. 👆👆
Manually refreshing timelines, checking profiles, and hopping between X and Telegram to see what key accounts are doing is tedious and easy to miss. This bot automates that entire workflow by tracking a curated list of accounts and pushing every important action into Telegram in real time.
Instead of constantly watching feeds, you get structured, high-signal notifications whenever tracked accounts join new communities, follow new profiles, post or reply, or join new Telegram channels or groups. That means less manual monitoring and a tighter grip on what really matters.
- Stay instantly aware when influential accounts join new X communities or Telegram groups that might signal alpha, trends, or new circles.
- Catch every follow event to map network expansion, new collaborations, and relationship patterns.
- Monitor tweets and replies in real time for sentiment, announcements, or early signals before they go viral.
- Keep a consolidated alert stream inside Telegram instead of juggling multiple apps and tabs.
- Scale tracking from a few accounts to hundreds with structured notifications and filtering.
| Feature | Description |
|---|---|
| Account Watchlist Management | Maintain a centralized list of X and Telegram accounts to monitor, with simple add/remove and tagging options. |
| X Follow Event Tracking | Detect and notify whenever a tracked X account follows a new profile, including username and profile link. |
| X Community Join Detection | Track when monitored accounts join a new X Community and send a detailed alert with community metadata. |
| Tweet & Reply Monitoring | Watch for new tweets and replies from tracked accounts and push rich, structured summaries into Telegram. |
| Telegram Channel/Group Join Alerts | Detect when tracked Telegram users join new channels or groups and notify with title, invite link (if available), and join time. |
| Real-Time Telegram Notifications | Deliver low-latency alerts directly into a configured Telegram chat or channel using the Telegram Bot API. |
| Flexible Filtering & Throttling | Allow per-account filters (e.g., tweets only, follows only) and rate limiting to avoid noisy or excessive notifications. |
| Persistence & State Tracking | Store last seen events, follows, and messages to avoid duplicates and ensure idempotent processing. |
| Robust Error Handling & Retries | Handle API failures, rate limits, and network glitches with exponential backoff, retries, and graceful degradation. |
| Structured Logging & Metrics | Provide detailed logs, metrics, and optional dashboards for monitoring throughput, error rates, and latency. |
| Pluggable Notification Formats | Support customizable message templates, inline buttons, and rich formatting for different tracking scenarios. |
| Multi-Account & Multi-Environment Support | Support multiple Telegram chats/environments (dev/stage/prod) and separate watchlists safely. |
| Security & Token Management | Use environment-based credential storage, scoped API keys, and defensive checks to avoid leaking sensitive data. |
| Webhook/Worker Architecture | Separate webhook ingestion from background workers for better scalability and performance. |
| Extensible Event Pipeline | Easily extend to track likes, quotes, or other X/Telegram signals without rewriting the core engine. |
| Step | Description |
|---|---|
| Input or Trigger | The system starts when new account activity is detected from X (via streaming/webhook/polling) or Telegram (via updates API) for any user in the watchlist. |
| Core Logic | Incoming events are normalized into a common internal schema, deduplicated against stored state, and routed through rules that determine whether they should generate a notification. |
| Output or Action | When an event passes filters, the bot formats a Telegram message (with links, usernames, and metadata) and sends it into the configured chat or channel. |
| Other Functionalities | Background workers handle retries, batching, and rate limiting; logs and metrics are captured for each event, and optional web dashboards or CLI tools surface the activity. |
| Safety Controls | Rate limits, cooldown intervals, per-account throttles, and jittered scheduling protect against API bans, spammy behavior, or accidental overload. |
| ... | The pipeline is designed to be modular so additional event sources or destinations can be plugged in with minimal changes. |
| Component | Description |
|---|---|
| Language | Python 3.11 for asynchronous, event-driven account tracking and notification logic. |
| Frameworks | FastAPI for webhook endpoints and REST utilities, plus an async Telegram framework (e.g., aiogram) for bot orchestration. |
| Tools | X API client library for account activity, Redis or PostgreSQL for state and caching, and Celery or RQ for background workers. |
| Infrastructure | Dockerized services with optional docker-compose, deployable on VPS or cloud (e.g., AWS) with GitHub Actions for CI workflows. |
x-telegram-python-account-activity-tracker-bot/
├── src/
│ ├── main.py
│ ├── app/
│ │ ├── __init__.py
│ │ ├── config.py
│ │ ├── dependencies.py
│ │ └── server.py
│ ├── trackers/
│ │ ├── __init__.py
│ │ ├── x_tracker.py
│ │ ├── telegram_tracker.py
│ │ └── state_manager.py
│ ├── notifications/
│ │ ├── __init__.py
│ │ ├── telegram_notifier.py
│ │ └── templates.py
│ ├── domain/
│ │ ├── __init__.py
│ │ ├── models.py
│ │ └── events.py
│ ├── workers/
│ │ ├── __init__.py
│ │ ├── queues.py
│ │ └── tasks.py
│ └── utils/
│ ├── logger.py
│ ├── rate_limiter.py
│ └── config_loader.py
├── config/
│ ├── settings.yaml
│ ├── accounts_watchlist.yaml
│ └── credentials.example.env
├── logs/
│ ├── app.log
│ └── workers.log
├── storage/
│ ├── state.db
│ └── migrations/
├── tests/
│ ├── __init__.py
│ ├── test_x_tracker.py
│ ├── test_telegram_notifier.py
│ └── test_event_pipeline.py
├── docker-compose.yml
├── Dockerfile
├── pyproject.toml
├── Makefile
└── README.md
- Social strategists use it to track the live behavior of key accounts on X and Telegram, so they can react to trends and conversations as they start.
- Community managers use it to see when important members join new communities or groups, so they can follow, engage, or replicate successful patterns.
- Analysts and traders use it to watch “signal” accounts for new follows, communities, and messages that might hint at new narratives or opportunities.
- Growth-focused teams use it to aggregate all key account actions into one Telegram stream, so they can collaborate around the same live feed.
- Influencer or partner scouts use it to monitor how target accounts expand their networks and communities over time.
Q: How many accounts can this bot track reliably? A: The architecture is built to handle dozens to hundreds of tracked accounts, depending on your hosting resources and API limits. With proper rate limiting and batching, you can scale up gradually while monitoring latency and throughput via logs and metrics.
Q: How close to real time are the notifications? A: For most setups, alerts are generated within a few seconds of the underlying event, depending on X and Telegram API behavior. In degraded or rate-limited conditions, the system falls back to short polling intervals or queued processing, still aiming to keep delays under a minute.
Q: Can I customize what events generate alerts? A: Yes. You can configure per-account and global rules to restrict notifications to specific event types such as follows, community joins, tweets, replies, or Telegram joins. Message templates are also customizable so you can include only the metadata that matters to you.
Q: Where does the bot run and how do I deploy it? A: The project ships with Docker and a docker-compose file so you can run it on any VPS or container-friendly environment. You only need to supply your environment variables, build the images, run the stack, and expose the webhook endpoints if you opt for webhook-based integrations.
Execution Speed: On a modest VPS (2 vCPU, 4 GB RAM), the bot can comfortably process 50–150 tracked accounts, handling bursts of several hundred events per minute while keeping median notification latency under 3–5 seconds for webhook-based flows.
Success Rate: With retries and backoff enabled, successful delivery of eligible notifications typically stays in the 92–94% range across production runs, excluding hard API failures or revoked credentials.
Scalability: By separating FastAPI webhooks from background workers and using a queue backend, the system can be scaled horizontally to handle higher loads—up to thousands of events per minute and multiple concurrent worker processes—without changing the core logic.
Resource Efficiency: Each worker process usually consumes under 150–250 MB RAM and low to moderate CPU, depending on event volume and logging verbosity. Most overhead is network-bound on X and Telegram API calls rather than raw computation.
Error Handling: The pipeline implements structured logging, correlation IDs for tracing events, automatic retries with exponential backoff, and circuit-breaker style protections for failing integrations. Non-critical errors are logged and skipped, while critical failures can be surfaced via dedicated alert channels in Telegram.
