The Next-Gen Modular Telegram Framework
Ether is a high-performance, modular Telegram userbot architecture built with Telethon and PyMongo Async. Designed for developers who prioritize security, sovereignty, and scalability.
Features • Structure • Configuration • Deployment • Commands • Development • Contributors
Ether is engineered to eliminate the most common security risks in the userbot ecosystem.
- Zero String Session Reliance: No third-party bots or risky session generators. Ether uses the official Telegram native authentication flow.
- Direct Auth: Use the
/logincommand to trigger an official Telegram OTP/2FA flow directly to your device. - Encrypted Storage: Your session data is stored securely on your server. It never touches a developer's database or public logs.
- No Middleware Risks: Your credentials remain private. No Replit, no external middleware, just direct communication with Telegram servers.
- Hybrid Engine: Orchestrates Telethon (Userbot) and Telegram Bot API concurrently for maximum flexibility.
- Plug-and-Play: Drop any
.pyscript into theplugins/directory to instantly extend functionality. - Native Async: Fully asynchronous architecture powered by
pymongonative async drivers for high-concurrency handling. - Health Monitoring: Integrated FastAPI heartbeat service for 100% uptime on cloud providers.
- Containerized: Production-ready Docker configuration for seamless local or cloud orchestration.
Ether follows a clean, modular directory structure for scalability and ease of development.
Ether/
├── assets/ # Static media and branding
├── config/ # Environment and global configuration
├── core/ # The engine: Userbot, Bot API, and Loader
├── logs/ # Persistent system and session logs
├── plugins/ # Add-on functionality (.py files)
├── services/ # Logic layers for database interactions
├── storage/ # MongoDB connection management
├── utils/ # Shared helpers and logging tools
├── main.py # Main entry point for the hybrid system
└── web_service.py # FastAPI heartbeat service
Ether is built on a modern, high-performance stack designed for low latency and high concurrency.
| Technology | Purpose |
|---|---|
| Python 3.11+ | Core programming language |
| Telethon | MTProto library for Telegram User & Bot API interaction |
| PyMongo Async | Native asynchronous driver for MongoDB |
| FastAPI | High-performance web framework for health monitoring |
| Uvicorn | ASGI server for production-grade web service |
| Docker | Containerization and environment isolation |
| python-dotenv | Environment variable management |
Caution
Security Warning: Never expose your environment variables or upload your .env file to public repositories. Anyone with access to your API_ID, API_HASH, or BOT_TOKEN can take full control of your account. Use your hosting provider's dashboard to set these variables securely.
Ether uses environment variables for configuration. These can be set in a .env file for local deployment or in your cloud provider's dashboard.
| Variable | Requirement | Description |
|---|---|---|
API_ID |
Required | Your Telegram API ID from my.telegram.org |
API_HASH |
Required | Your Telegram API Hash from my.telegram.org |
BOT_TOKEN |
Required | Your Bot Token from @BotFather |
OWNER_ID |
Required | Your numeric Telegram User ID |
MONGO_URI |
Required | MongoDB Atlas connection string |
BOT_USERNAME |
Required | Your Bot's username (without @) |
DB_NAME |
Optional | Database name (Default: Ether) |
DEBUG |
Optional | Set to true for verbose logging (Default: false) |
WEB_SERVICE |
Optional | Set to true for cloud keep-alive services |
PORT |
Optional | Port for the web service (Default: 8080) |
Ether is designed to be deployed anywhere. Choose the platform that fits your needs.
Render provides the most stable environment for Ether with native Docker support.
- Fork this repository to your own GitHub account.
- Click the Deploy to Render button above.
- Connect your GitHub account and select the forked repository.
- Configure the Environment Variables (see Configuration).
- Crucial: Ensure
WEB_SERVICEis set totrueto prevent the service from sleeping.
- Crucial: Ensure
- Render will automatically build and deploy the container.
Cloud providers like Render often put free-tier apps to "sleep" after inactivity. Use these tools to ensure Ether stays online 24/7.
To prevent Render from sleeping, set up a monitor to ping your bot's URL:
- Go to UptimeRobot and create a free account.
- Click Add New Monitor.
- Monitor Type:
HTTP(s) - Friendly Name:
Ether Userbot - URL: Your Render app URL (e.g.,
https://your-app.onrender.com/) - Monitoring Interval: Every
5 minutes. - Click Create Monitor.
If you need to trigger specific bot actions or ensure the web service remains active via external triggers:
- Create an account at Cron-job.org.
- Create a New Cronjob.
- URL: Your Render app URL.
- Schedule: Every 5 or 10 minutes.
- This acts as a secondary heart-beat for your bot.
Ideal for users familiar with the Heroku ecosystem.
- Click the Deploy to Heroku button above.
- Enter a unique app name and fill in the required environment variables.
- Once the build finishes, go to the Resources tab.
- Important: Turn off the
webdyno and turn ON theworkerdyno. - Render will automatically build and deploy the container.
A simple, zero-config deployment platform.
- Click the Deploy Now button for JustRunMyApp above.
- Paste the repository URL:
https://github.com/LearningBotsOfficial/Ether - Follow the on-screen prompts to set your Environment Variables.
- Launch the app and wait for the status to show "Running".
The preferred method for developers and privacy-focused users.
# 1. Clone the repository
git clone https://github.com/LearningBotsOfficial/Ether.git && cd Ether
# 2. Create and configure your .env file
cp .env.example .env
nano .env
# 3. Build and launch with Docker Compose
docker-compose up -d --buildTip
Using Docker Compose handles the health checks and automatic restarts for you.
For users who want full control over the environment.
-
Install Python 3.11+ Make sure you have Python 3.11 or higher installed on your system.
-
Prepare the Project Clone your repository and enter the directory:
git clone https://github.com/LearningBotsOfficial/Ether cd Ether -
Setup the Environment Create a virtual environment and install dependencies:
python -m venv .venv # Activate the virtual environment # On Linux/macOS: source .venv/bin/activate # On Windows: .venv\Scripts\activate # Install dependencies pip install -r requirements.txt
-
Configure Environment Variables Copy the example environment file and edit it with your credentials:
cp .env.example .env nano .env # Or your preferred editor -
Run the Bot You can run the bot directly using:
python main.py
To add a new library:
pip install <package-name>
# Then update requirements.txt
pip freeze > requirements.txtTo remove a library:
pip uninstall <package-name>
# Then update requirements.txt
pip freeze > requirements.txtTo upgrade all dependencies to their latest versions:
pip install --upgrade -r requirements.txt
pip freeze > requirements.txtWhenever you pull new changes from GitHub that include an updated requirements.txt, simply run:
pip install -r requirements.txtThis ensures your local .venv matches the project's requirements.
Unlike traditional userbots, Ether doesn't use risky "String Sessions". Follow these steps to authorize your account:
- Open your bot on Telegram (the one created via
@BotFather). - Send the
/logincommand. - The bot will prompt you for your phone number.
- Enter the OTP sent by Telegram (and your 2FA password if enabled).
- Success! Your session is now securely stored in your own MongoDB database.
Ether provides a suite of professional tools. All userbot commands are prefixed with . by default.
| Command | Action | Platform |
|---|---|---|
/login |
Starts the native Telegram OTP/2FA login flow. | Official Bot |
/restart |
Restarts the bot instance to apply changes. | Official Bot |
| Command | Description |
|---|---|
.alive |
View system status, uptime, and version info. |
.ping |
Check the current latency between Ether and Telegram. |
.help |
Open the interactive help menu (Inline Support). |
.commands |
Displays a full list of all loaded plugin commands. |
| Command | Description |
|---|---|
.allow |
Approves a user to message you in DMs. |
.disallow |
Revokes a user's permission and enables the shield. |
.setwelcome |
Sets a custom welcome message for new DM users (Reply). |
.clearwelcome |
Resets the DM welcome message to default. |
.setwarn <n> |
Set max warnings before a user is auto-blocked. |
| Command | Description |
|---|---|
.shortcut <name> |
Save the replied message as a permanent shortcut. |
.get <name> |
Retrieve and send a saved shortcut. |
.delshortcut <n> |
Delete a specific shortcut by its name. |
.shortcuts |
List all your saved shortcuts and snips. |
.tagall <msg> |
Mention all members in a group safely. |
.fonts <text> |
Transform text into stylish mathematical fonts. |
Ether is built to be modular. You can add new features by creating a .py file in the plugins/ directory. Each plugin must implement a setup function.
def setup(ether, db, owner_id):
"""
ether: The Telethon TelegramClient instance.
db: The PyMongo async database instance.
owner_id: The numeric ID of the bot owner.
"""This example shows how to use the database to save and retrieve simple notes.
from telethon import events
def setup(ether, db, owner_id):
# Collection reference
notes = db["notes"]
@ether.on(events.NewMessage(pattern=r"^\.save (\w+) (.+)$", outgoing=True))
async def save_note(event):
if event.sender_id != owner_id: return
name = event.pattern_match.group(1)
text = event.pattern_match.group(2)
await notes.update_one(
{"name": name},
{"$set": {"content": text}},
upsert=True
)
await event.edit(f"Note '{name}' saved successfully.")
@ether.on(events.NewMessage(pattern=r"^\.getnote (\w+)$", outgoing=True))
async def get_note(event):
if event.sender_id != owner_id: return
name = event.pattern_match.group(1)
note = await notes.find_one({"name": name})
if note:
await event.edit(f"**Note {name}:**\n{note['content']}")
else:
await event.edit("Note not found.")Get help, report bugs, and stay updated with the latest plugins and features from the Ether ecosystem.
| Platform | Purpose | Link |
|---|---|---|
| Telegram Channel | Announcements, version releases, and security patches. | Join Channel |
| Telegram Group | Community support, plugin troubleshooting, and general chat. | Join Support |
| Developer Network | Collaboration with the LearningBotsOfficial ecosystem. | Join Network |
Note
For technical bug reports and detailed feature requests, please use the GitHub Issues tracker.
We appreciate the support and contributions from our amazing community.
Ether is a professional open-source framework. By utilizing this software, you agree to the following:
- Attribution: Original credits to LearningBotsOfficial must remain intact in all files.
- Forks: Public forks must link back to the original repository.
- Commercial Use: Reselling this project or distributing paid clones is strictly prohibited.
- Liability: Use this software responsibly. We are not responsible for any account bans or misuse.
© 2026 LearningBotsOfficial. All rights reserved. Licensed under the MIT License.
Made with love for the Open Source Community by LearningBotsOfficial