Browse by type
A powerful, open-source, and feature-rich Telegram bot designed to rename, customize, and transform files effortlessly with support for custom thumbnails, metadata, captions, and video conversion.
⚡ Fast • 📝 Flexible • 🖼️ Customizable
Rename Bot is a powerful Telegram file management bot that goes far beyond simple renaming. It combines 4GB file support, premium plans, thumbnails, metadata, captions, and file conversion into one convenient Telegram-based workflow.
💡 Take full control of your files with powerful customization tools.
flowchart TB
subgraph TG["Telegram"]
U["👤 User"]
API["☁️ Telegram API
(MTProto)"]
CH["📢 Channels
BIN / LOG / FSUB"]
end
subgraph PROC["bot.py — one process"]
MAIN["🤖 TechifyBots client
bot token · workers=200 · 50 xmit"]
USER["👤 app client (file_rename)
STRING_SESSION · 4GB uploads"]
WEB["🌐 aiohttp web server
:$PORT → welcome.html"]
MW["🛡️ middleware chain
maintenance → fsub → user-mw"]
FEAT["⚙️ feature plugins
rename · admin · plans · metadata"]
end
subgraph DATA["MongoDB — Rename_Bot"]
CDB[("👥 user
profile + quota")]
PDB[("💎 premium
expiry keyed by id")]
JDB[("🔐 join_requests
+ fsub_cache")]
SDB[("🔧 settings
maintenance flag")]
end
U <--> API
API <--> MAIN & USER
MAIN --> CH
USER --> CH
MAIN --> MW --> FEAT
FEAT <--> CDB & PDB
MW <--> JDB & SDB
WEB --> CDB & PDB
Two Telegram clients share the process: the main bot client handles all commands, and an optional user-session client (STRING_SESSION) uploads files >2GB. The aiohttp status page lives in the same process on $PORT.
flowchart LR
M["📩 any update"] --> G1["🚧 maintenance
group -1
drop + notice"]
G1 -->|bot alive| G2["🔐 fsub gate
group -10
join check"]
G2 -->|member| G3["👤 user middleware
register · ban check"]
G3 --> OK["✅ feature handler
rename · admin · plans"]
G1 -->|under maintenance| STOP1["⛔ stopped"]
G2 -->|not joined| STOP2["🔒 join prompt"]
G3 -->|banned| STOP3["🚫 banned notice"]
Earlier groups run first and StopPropagation halts the chain — maintenance blocks everything (except bypass IDs), force-subscribe blocks non-members, banned users never reach features.
flowchart TB
S["📤 user sends file"] --> INFO["📋 rename_start
media info + ForceReply"]
INFO --> NAME["✏️ refunc
new name → type buttons"]
NAME --> CB["🔘 upload# callback
document · video · audio"]
CB --> DL["⬇️ download to Renames/"]
DL --> META{"🏷️ metadata mode?"}
META -->|on| FF["🎞️ ffmpeg copy-codec
+ titles → Metadata/"]
META -->|off| UP["⬆️ upload"]
FF --> UP
UP --> TH["🖼️ thumbnail
custom or media · 320px"]
TH --> BIG{"📦 >2GB?"}
BIG -->|yes| U4["👤 user-session upload
→ BIN + user, cleanup"]
BIG -->|no| U2["🤖 bot upload
→ BIN copy, cleanup"]
Downloads land in Renames/, metadata rewrites in Metadata/, every path is cleaned via remove_path. Premium daily quota is reserved before download and refunded on failure.
flowchart LR
H["🔄 GET /"] --> GS["📊 get_status()
cached counts 60s"]
H --> SP["🚀 network_speed_label()
Ookla · cached 10min"]
GS & SP --> T["📝 fill 17 placeholders
welcome.html"]
T --> R["🌐 styled dashboard"]
| Layer | Technology | Version | Role |
|---|---|---|---|
| Language | Python | 3.14.7 (python:3.14-slim in Docker) |
Async runtime, pinned in .python-version |
| Telegram | Kurigram (+ TgCryptoRust) | 2.2.26 / 1.3.1 |
Pyrogram fork — bot + user-session clients, workers=200 |
| Web | aiohttp | 3.14.3 |
Status dashboard (/, 17-placeholder template) |
| Database | MongoDB (pymongo AsyncMongoClient) |
4.18.1 |
user (profile + quota) · premium (expiry keyed by id, indexed) · join_requests · fsub_cache · settings — one shared client |
| Media | ffmpeg / ffprobe | system (Docker-baked) | Duration probe, copy-codec metadata rewrite, 320px thumbnails (Pillow 12.3.0) |
| Loop | uvloop | 0.22.1 |
Fast event loop, stdlib fallback |
| Metrics | psutil + Ookla speedtest | 7.2.2 |
CPU/RAM/disk + live network label (10-min cache) |
| Config | python-dotenv | 1.2.3 |
14 env vars (config.py ↔ app.json ↔ render.yaml, CI-checked) |
| CI/CD | GitHub Actions + CodeQL + Dependabot | — | build · audit · validate gates, weekly CodeQL + pip updates |
| Deploy | Docker · Heroku · Render · Koyeb/Railway | — | Dockerfile · app.json · render.yaml in repo |
Single-process design: bot + optional 4GB user client + web server share one event loop and one Mongo client — no inter-service wiring,
SIGINT/SIGTERMgraceful shutdown.
New to this project?
Watch this short video to understand what the bot is, why it's useful, how it works, explore its key features, and learn the required configuration before deployment.
📺 Watch on YouTube: Project Overview
| Variable | Description |
|---|---|
API_ID |
Telegram API ID |
API_HASH |
Telegram API Hash |
BOT_TOKEN |
Telegram Bot Token |
DB_URL |
MongoDB URI |
DB_NAME |
MongoDB database name (default: Rename_Bot) |
ADMIN |
Telegram User ID |
PIC |
Start image URL |
BIN_CHANNEL |
Bin Channel |
IS_FSUB |
Enable / Disable Force Subscribe |
FSUB_EXPIRE |
Force Subscribe Expire Time |
AUTH_CHANNELS |
Force Subscribe Channels |
AUTH_REQ_CHANNELS |
Request FSUB Channels (membership verified live) |
LOG_CHANNEL |
Log Channel |
STRING_SESSION |
Session string required for 4GB file processing |
PORT |
Web server port (default: 8080) |
💎 4GB Support —
STRING_SESSIONis optional. Add a Kurigram v2 String Session (Pyrogram-compatible) to enable 4GB file processing.⚠️ Without
STRING_SESSION, the bot will continue to work with its standard file-size limit.
start - Check Bot Alive.
setprefix - Set Your Prefix
seeprefix - See Your Prefix
delprefix - Delete Your Prefix
viewthumb - To View Current Thumbnail.
delthumb - To Delete Current Thumbnail.
setcaption - To Set A Custom Caption.
seecaption - To See Your Custom Caption.
delcaption - To Delete Custom Caption.
setsuffix - Set Your Suffix
seesuffix - See Your Suffix
delsuffix - Delete Your Suffix
plans - to check all available plans.
myplan - to check your active plan.
metadata - To set custom metadata.
🔒 Owner Commands
ban - ban a user.
unban - unban a user.
banned - list all banned users.
status - get bot statistics.
broadcast - Send message to users.
logs - get recent bot logs.
addpremium - add a user to premium
removepremium - remove a user from premium
restart - restart the bot.
maintenance - Toggle maintenance mode.
delreq - Clear pending force-subscribe join requests.
Need help deploying this project? We've got you covered.
[!TIP] 📺 Complete Deployment Playlist — Follow the step-by-step video tutorials to get started.
.python-version; Docker uses python:3.14-slim)PATH (metadata + thumbnails; ffprobe too)DB_URL)API_ID / API_HASH / BOT_TOKEN, plus ADMIN user IDpip install -r requirements.txt
export API_ID=… API_HASH=… BOT_TOKEN=… ADMIN=… DB_URL=mongodb://localhost:27017 LOG_CHANNEL=…
python bot.py
| Platform | File | Notes |
|---|---|---|
| Docker (any host) | Dockerfile |
ffmpeg + Ookla speedtest baked in; CMD ["python", "bot.py"] (bot.py entrypoint) |
| Heroku | app.json, Procfile, heroku.yml |
One-click via app.json; all 14 env vars declared |
| Render | render.yaml (runtime: docker, health check /) |
Docker build of Dockerfile (ffmpeg + Ookla inside), autoDeploy: false; all 14 env vars declared |
| Koyeb / Railway | Dockerfile |
Deploy from repo, use the Docker builder, set env vars below |
All 14 are declared in app.json and render.yaml (CI's validate job fails the PR if they drift from config.py):
API_ID · API_HASH · BOT_TOKEN · DB_URL · DB_NAME · ADMIN · PIC · BIN_CHANNEL · LOG_CHANNEL · STRING_SESSION · IS_FSUB · AUTH_CHANNELS · AUTH_REQ_CHANNELS · FSUB_EXPIRE · (PORT is injected by the host, default 8080)
💎 4GB Support —
STRING_SESSIONis optional. Add a Kurigram v2 String Session (Pyrogram-compatible) to enable 4GB file processing. Without it the bot keeps its standard 2GB limit.
Every push/PR runs .github/workflows/ci.yml (badge ↑ top):
| Job | What it catches |
|---|---|
build |
Syntax errors (compileall), bug-clas |
$ claude mcp add Rename-Bot \
-- python -m otcore.mcp_server <graph>