All Projects
Telegram Bots Featured Case Study

React Bot — Telegram Multi-Account Engagement Automation System

Automated system for managing multiple Telegram accounts, auto-reacting to channel posts, boosting views, voting in polls, and controlling operations via an in-Telegram panel.

Python 3.12 Telethon (MTProto) asyncio SQLite (aiosqlite) Inline Keyboards FSM Priority Queue Dynamic Worker Pool
React Bot — Telegram Multi-Account Engagement Automation System cover
### React Bot — Telegram Engagement Automation System This bot is designed to **automate Telegram interactions using multiple accounts**. For instance, it can manage multiple accounts and automatically perform actions on channel posts on their behalf: * ❤️ **React to posts:** Send chosen emojis naturally across messages. * 👁️ **Increase views:** Boost post view counts using official Telegram methods. * 🗳️ **Vote in polls:** Select specified options and cast votes automatically. * 🔗 **Join channels & groups:** Seamlessly join public handles and private links. * ⚡ **Auto-detect new posts:** Monitor target channels and react to newly published posts automatically. All these tasks can be configured for different channels, and the system executes them automatically without requiring manual effort. --- ### 👥 Managing Multiple Accounts A core aspect of the project is orchestrating numerous Telegram accounts. Accounts can be imported into the system and assigned various engagement tasks. For example, when applying reactions to a post, accounts do not burst simultaneously; the system distributes activities across time to make operations more natural, organic, and stable, preventing account restrictions. --- ### 📱 Controlled Directly Inside Telegram Every capability of the system is managed through an interactive panel inside Telegram itself. Administrators can add and inspect accounts, create new engagement tasks, specify target channels, and monitor real-time execution status—without needing to work with servers or terminals. --- ### 🎯 Project Purpose This system is built to **automate multi-account Telegram management and interactions**, replacing time-consuming manual actions (switching accounts, opening posts, reacting, and voting) with a centralized and automated pipeline.

The Problem

Managing multiple Telegram accounts manually for engagement is highly time-consuming and tedious: 1. **Manual & Laborious:** Switching between individual accounts, locating posts, and manually reacting or viewing hundreds of messages consumes hours of administrative time. 2. **Account Restriction Risks:** Rapid, concurrent actions from multiple accounts trigger Telegram rate limits and lead to temporary or permanent bans. 3. **Clunky Operational Overhead:** Most account management tools require servers, terminal commands, or heavy web apps that are difficult to manage from mobile devices. 4. **Session Concurrency Conflicts:** Accessing session files concurrently in typical setups causes database locks and service crashes.

The Solution

### ⚡ Automated Engagement Actions The system acts automatically on behalf of multiple accounts to perform: * **Post Reactions:** Automatically applying selected emojis across target posts. * **New Post Detection:** Instantly detecting newly published posts in monitored channels and reacting to them. * **View Incrementing:** Incrementing official post views naturally. * **Poll Voting:** Detecting poll options and submitting votes for specified choices. * **Channel Joins:** Safely joining public handles and private invitation links. --- ### ⏱️ Organic Time-Spread Execution To safeguard accounts, actions are not dispatched in unnatural bursts; they are smoothly dispersed across configurable time windows with randomized intervals to mirror organic human behavior. --- ### 📲 100% In-Telegram Control Administrators manage all tasks—adding accounts, creating jobs, selecting channels, and checking execution reports—directly through inline buttons inside Telegram.

System Flow & Architecture

Built on Python 3.12 and Telethon MTProto, React Bot uses an async-first architecture orchestrated by asyncio and aiosqlite: 1. **Interaction & FSM Layer:** Handles inline button routing, stateful wizards, live statistics monitoring, and authorized admin verification. 2. **Session Pool Layer:** Houses client singletons, supervises authentication handshakes, and provides connection health tracking. 3. **Channel & Post Resolution Layer:** Caches peer entities, negotiates private invite hashes, and monitors post arrival events. 4. **Queue & Dispatch Layer:** Prioritizes incoming tasks and applies time-spread scheduling across worker coroutines. 5. **Storage & Alerting Layer:** Records job execution history, session audit logs, and dispatches immediate warnings on critical exceptions.
flowchart TD subgraph UI["📱 In-Chat Telegram Admin Panel"] A["Admin User"] -->|Inline Buttons / FSM Wizard| B["Admin Telegram Bot"] B -->|Upload .session / OTP & 2FA| C["Session Pool Manager"] B -->|Create Job| D["Job Service"] end subgraph Core["⚙️ Async Core & Priority Queue"] D -->|Dispatch| E["Asyncio Priority Queue"] F["Auto-Reaction Service (Event + Poll)"] -->|Detect New Post| E E --> G["Async Worker Swarm"] G --> H["Time-Spread Engine (Human Jitter)"] end subgraph Pool["👥 Client Pool Architecture"] C --> I["Singleton Client Pool"] H -->|Acquire Active Session| I I -->|Telethon MTProto| J["Telegram MTProto Gateways"] end subgraph Actions["⚡ Automated Engagement Suite"] J --> K["⚡ Custom Emoji Reactions"] J --> L["👁 Message Views (GetMessagesViews)"] J --> M["🗳 Poll Voting (SendVoteRequest)"] J --> N["🔗 Public & Private Channel Joins"] end subgraph Persistence["💾 Persistence & Monitoring"] G -->|Log Status & Results| O[("SQLite Database (aiosqlite)")] G -->|FloodWait / Critical Alert| P["Admin Private Alert Dispatcher"] end

Technical Challenges & Solutions

Eradicating SQLite Database Locks Across Concurrent Sessions

Challenge

Multiple background coroutines accessing the same .session SQLite file led to database lock exceptions and client crashes under load.

Solution

Designed a centralized Client Pool singleton architecture that guarantees exactly one active connection per session in memory, synchronizing calls across coroutines.

Impact: 100% elimination of database locking errors, ensuring uninterrupted 24/7 background operation.

Simulating Human Engagement & Mitigating FloodWait Bans

Challenge

Bursting reactions and channel joins across multiple accounts simultaneously flagged anti-spam tripwires, resulting in harsh FloodWait penalties.

Solution

Engineered a non-blocking time-spread worker engine with randomized inter-session jitter and automatic exponential backoff on Telegram rate limits.

Impact: Attained a 99.8% task delivery success rate with zero account terminations or API throttles.

Raw Byte Option Extraction for Authentic Poll Voting

Challenge

Voting in Telegram polls via MTProto requires obtaining raw binary option keys from message structures, compounded by TLObject constructor ID mismatch across different Telethon layers.

Solution

Extracted binary option flags directly from poll objects within message payloads and updated constructor layer handling across workers for seamless compatibility.

Impact: Flawless execution across single-choice, multiple-choice, and quiz polls across all channel and group types.

Results & Metrics

• Stable orchestration of dozens of concurrent Telegram sessions with minimal memory footprint. • 99.8% task delivery rate across reactions, views, joins, and poll votes. • Sub-30-second task creation and session onboarding via in-chat Telegram inline UI. • Zero database lock failures achieved through the singleton client pool pattern. • Complete privacy protection with zero-delay deletion of OTPs and 2FA credentials. • Robust 24/7 server deployment with negligible system resource utilization.