A Next-Generation Telegram Group Management Bot
Built from the ground up using modern asynchronous architecture with Aiogram 3 and SQLAlchemy 2.0.
PglRobot is a highly advanced, lightning-fast Telegram Bot designed to securely and efficiently manage group chats of any size. Moving away from legacy synchronous wrappers, PglRobot is built using Aiogram 3 and Telethon in a Hybrid Architecture, offering fully non-blocking I/O and rapid MTProto message processing, making it one of the most responsive moderation bots available today.
- ⚡ Blazing Fast Async Core: Entirely built on Aiogram 3.x and SQLAlchemy 2.0 (
asyncpg). This guarantees massive scalability and zero lag, completely avoiding the blocking bottlenecks of legacy SQLite bots. - 🧠 Hybrid Engine: Seamlessly combines the standard Bot API (Aiogram) for rapid command processing with deep MTProto functionality (Telethon) for advanced tasks.
- 🛡️ Intelligent Anti-Spam: Drops reliance on broken third-party APIs. Uses a built-in heuristic scoring system to instantly catch and ban crypto-scammers and spam rings before they can disrupt your chat.
- 🌐 Native Federations: Cross-group ban networks are fully supported natively to protect your entire community ecosystem. Ban once, secure everywhere.
- 🔒 Enterprise Stability: 100% strictly typed codebase verified by
basedpyrightwith 0 typing errors. Written entirely from scratch to be crash-proof.
PglRobot comes packed with a powerful suite of plugins and features:
- AntiSpam: Strict anti-spam protections to keep your group clean.
- Purge System: Quickly delete bulk messages (
/purge,/del). Includes a robust chunking algorithm to bypass API limits on massive purges. - Rules: Set and enforce group rules (
/rules,/setrules). - Locks & Blacklists: Advanced content locking (
/lock url,/lock photo) and text censoring (/addblacklist). - Approvals & Trust: Whitelist your most loyal members (
/approve) or use the Karma-like Trust system (/trust) to automatically bypass locks. - Force Subscribe & Join Requests: Force members to join a channel (
/fsub) and auto-approve their group join requests (/autoapprove). - Custom Filters: Create highly customized text or media auto-replies (
/filter,/stop). - Connections: Manage your group's settings privately by connecting to it in PM (
/connect). - NSFW Detection: Machine-learning powered image scanning to automatically delete nudity or gore (powered by Sightengine).
- Global Bans (GBan): Sudo users can globally ban scammers across all groups the bot manages simultaneously.
- Federations (Feds): Group creators can link multiple groups into a federation to share a unified ban list. Ban once, remove everywhere!
- Zombies (MTProto): Uses Telethon to bypass Bot API limits and scan for or kick "Deleted Accounts" from your groups (
/zombies,/zombies clean).
- Welcome & Goodbye: Highly customizable welcome messages supporting Text, Photos, Videos, and Gifs, with inline buttons and dynamic formatting tags (e.g.,
{first},{chatname}). - Karma System: A fun reputation system! Users can reply to messages with
+1,thanks, orproto give Karma, and-1ornoobto take it away. - AFK (Away From Keyboard): Let your friends know when you are busy. The bot will automatically reply to anyone who mentions you!
- Notes System: Save important text or media using
/save <notename>and retrieve it using#<notename>.
- Night Mode: Automatically locks your group (disabling messaging and media) at 12:00 AM IST and unlocks it at 6:00 AM IST to prevent late-night spam while admins are asleep!
- Framework: Aiogram 3.x
- Database: PostgreSQL (with
asyncpg) - ORM: SQLAlchemy 2.0
- Scheduling: APScheduler
-
Clone the repository:
git clone https://github.com/yourusername/PglRobot.git cd PglRobot -
Install requirements:
pip install -r requirements.txt
-
Configure Environment: Edit the
PglRobot/config.pyfile to include your tokens and database URI, or export them as environment variables:BOT_TOKEN: Your Telegram Bot Token.OWNER_ID: Your Telegram User ID.SQLALCHEMY_DATABASE_URI: Your PostgreSQL URI (e.g.,postgresql+asyncpg://user:pass@localhost/dbname).
-
Run the Bot:
python -m PglRobot
Once the bot is running, simply add it to your group, promote it to Admin, and type /help to see a fully interactive menu of all available commands and how to configure each plugin!
Every line of plugin logic in PglRobot 2.0 has been meticulously written from scratch to leverage modern asynchronous paradigms. We would like to extend our gratitude to the developers of our core underlying technologies:
- Aiogram Team: For their incredibly robust and blazing-fast Telegram Bot API framework.
- Telethon Team: For providing unparalleled access to the MTProto library.
- SQLAlchemy: For the powerful async ORM.