Skip to content

Repository files navigation

TG-RenameBot

A Telegram bot to rename/convert media files, written in Python 3 using Pyrogram.

Send any file → pick an action via inline buttons (rename as file/video, convert between file and video) → bot downloads, renames or remuxes, and re-uploads with your saved custom thumbnail.

Requirements

  • Python 3.10+
  • ffmpeg installed on the system
  • PostgreSQL database

Installation (VPS)

git clone https://github.com/mrvishal2k2/TG-RenameBot
cd TG-RenameBot
pip install -r requirements.txt
# set environment variables (see below)
python3 bot.py

Docker

docker build -t tg-renamebot .
docker run --env-file .env tg-renamebot

Copy .env.example to .env and fill in your values.

Environment Variables

Required:

VariableDescription
APP_IDTelegram API ID from my.telegram.org
API_HASHTelegram API hash from my.telegram.org
TG_BOT_TOKENBot token from @BotFather
OWNER_IDSpace-separated user IDs with admin access
DATABASE_URLPostgreSQL connection URI

Optional:

VariableDefaultDescription
AUTH_USERS(everyone)Space-separated user IDs allowed to use the bot
DOWNLOAD_LOCATION./Bot/DOWNLOADSLocal path for temporary downloads
OWNER_USERNAMEOwner's Telegram username (without @)
CUSTOM_CAPTIONText appended to file captions after the filename

Commands

/start - start the bot
/help - usage instructions
/showthumb - show your saved custom thumbnail
/deletethumb - delete your saved custom thumbnail
/log - (owner only) get the log file

Developer

Contributing

Pull requests are welcome. Keep deployment simple and newbie-friendly.

About

Yup an another telegram Rename bot with multiple useful functionz

Topics

Resources

Stars

65 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages