Skip to content

maduwa-deweni/File-Rename-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Telegram File Rename Bot

A powerful and efficient Telegram bot designed to rename files and customize thumbnails with ease. Built with Pyrogram and MongoDB.

Developer: MaDuWa πŸ‘¨β€πŸ’»


⭐ Support the Developer!

If you find this bot useful, please consider Forking and leaving a Star ⭐ on this repository! Your support is my biggest motivation to keep building and releasing more awesome open-source projects for the community. Let's grow together! πŸš€


✨ Features

  • Fast Renaming: Optimized using Pyrogram for high-speed file processing.
  • Custom Thumbnails: Set and save custom thumbnails for your files.
  • Permanent Storage: Uses MongoDB to store user settings and thumbnails.
  • FFmpeg Support: Includes FFmpeg for handling media metadata effectively.
  • Multi-Platform: Easily deployable on local machines, Docker, or Cloud Platforms (Koyeb, Render, Heroku).

πŸ›  Configuration (Environment Variables)

To run the bot, you need to configure the following environment variables:

Variable Description
API_ID Your Telegram API ID from my.telegram.org.
API_HASH Your Telegram API HASH from my.telegram.org.
BOT_TOKEN Your Bot Token from @BotFather.
MONGODB_URI Your MongoDB connection string.
ADMIN_ID The Telegram User ID of the bot owner.
DOWNLOAD_LOCATION Path for temporary file downloads (Default: ./downloads).
THUMB_LOCATION Path for saving thumbnails (Default: ./thumbs).

πŸ“¦ Requirements

The following dependencies are required to run the bot:

  • pyrogram==2.0.106
  • TgCrypto
  • motor
  • dnspython
  • Pillow
  • ffmpeg-python
  • aiofiles

πŸš€ Deployment Guide

πŸ’» 1. Local Deployment

  1. Clone the Repository:
    git clone [https://github.com/your-username/rename-bot.git](https://github.com/your-username/rename-bot.git)
    cd rename-bot
  2. Install Dependencies:
    pip install -r requirements.txt
  3. Run the Bot:
    python3 bot.py

🐳 2. Docker Deployment

  1. Build the Docker Image:
    docker build -t rename-bot .
  2. Run the Container:
    docker run -d --name rename-bot \
      -e API_ID=123456 \
      -e API_HASH="your_api_hash" \
      -e BOT_TOKEN="your_bot_token" \
      -e MONGODB_URI="your_mongodb_uri" \
      -e ADMIN_ID=your_id \
      rename-bot

☁️ 3. Koyeb Deployment

  1. Create an account on Koyeb.
  2. Click on Create Service and select GitHub.
  3. Connect your GitHub account and select this repository.
  4. Choose the Dockerfile builder option.
  5. In the Environment Variables section, add all your config variables (API_ID, BOT_TOKEN, etc.).
  6. Click Deploy and wait for the build to finish.

☁️ 4. Render Deployment

  1. Create an account on Render.
  2. Click New and select Background Worker.
  3. Connect your GitHub account and select this repository.
  4. Set the runtime to Docker.
  5. Scroll down to Advanced and add your Environment Variables.
  6. Click Create Background Worker.

☁️ 5. Heroku Deployment

  1. Create an account on Heroku.
  2. Go to your Dashboard and click New -> Create new app.
  3. Go to the Settings tab and click Reveal Config Vars. Add all your environment variables here.
  4. Go to the Deploy tab, select GitHub as the deployment method, and connect this repository.
  5. Scroll down to Manual Deploy and click Deploy Branch.
  6. Once deployed, go to the Resources tab and turn on the worker dyno.

πŸ“„ Dockerfile

The project uses the following Docker configuration:

FROM python:3.9-slim

RUN apt-get update && apt-get install -y ffmpeg

WORKDIR /app

COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .

CMD ["python", "bot.py"]

🀝 Credits

About

πŸš€ Powerful Telegram Rename Bot with Custom Thumbnail support. Built with Pyrogram, MongoDB, and Docker support. Developed by MaDuWa.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors