Skip to content

devil-jackbox/File-Sharing-Telegram-bot

 
 

Repository files navigation

File-sharing-Bot

Telegram Bot to store Posts and Documents and it can Access by Special Links. I Guess This Will Be Usefull For Many People.....😇.

Features

  • Fully customisable.
  • Customisable welcome
  • More than one Posts in One Link.
  • Can be deployed on heroku directly.

Setup

  • Add the bot to Database Channel with all permission

Installation

Deploy on Heroku

BEFORE YOU DEPLOY ON HEROKU, YOU SHOULD FORK THE REPO AND CHANGE ITS NAME TO ANYTHING ELSE
Deploy

Check This Tutorial Video on YouTube for any Help
Thanks to Erich and his InFoTel for this Video

Deploy on Railway

Deploy on Railway

Deploy on Koyeb

The fastest way to deploy the application is to click the Deploy to Koyeb button below.

Deploy to Koyeb

Deploy in your VPS

git clone https://github.com/Sachinanand99/File-Sharing-Bot.git
cd File-Sharing-Bot
pip3 install -r requirements.txt
# <Create config.py appropriately>
#if you are using any hosting services use dotenvtemplate.txt for putting environment variables
python3 main.py

Basic Commands

  • /start - Check whether bot is online 🟢
  • /stats - Uptime of the bot (admin only) ⏱️
  • /users - Total users active (admin only) 👥
  • /batch - To generate the link in batch (admin only) 🔗
  • /genlink - To generate link (admin only) 🔀
  • /auth - For using the bot which will send the ID to the owner's DM. The owner will add the admin to config file and restart the bot.

Secret Commands

  • /broadcast - Reply to any message to broadcast it to all users(owner only).
  • /auth_secret <id> - (for owner only) when the user is verified for admin and owner restarts the bot, this command will send the user of which the id is written will get a message to join the channel from where he/she can forward message for using the batch command.

Variables

  • API_HASH Your API Hash from my.telegram.org
  • APP_ID Your API ID from my.telegram.org
  • TG_BOT_TOKEN Your bot token from @BotFather
  • OWNER_ID Must enter Your Telegram Id
  • CHANNEL_ID Your Channel ID eg:- -100xxxxxxxx
  • DATABASE_URL Your mongo db url
  • DATABASE_NAME Your mongo db session name
  • TIME Time in seconds for message to get delete after downloading file
  • ADMINS Optional: A space separated list of user_ids of Admins, they can only create links
  • START_MESSAGE Optional: start message of bot, use HTML
  • FORCE_SUB_MESSAGEOptional:Force sub message of bot, use HTML and Fillings
  • FORCE_SUB_CHANNEL Optional: ForceSub Channel ID, leave 0 if you want disable force sub
  • FORCE_SUB_CHANNEL2 Optional: ForceSub Channel ID, leave 0 if you want disable force sub 2, bot may become a bit slower if you add this.
  • PROTECT_CONTENT Optional: True if you need to prevent files from forwarding

Token verification variables

  • USE_SHORTLINK Turn this feature on or off using True or False
  • SHORTLINK_URL Your Shortner url api.shareus.io,
  • SHORTLINK_API shortner api key.
  • VERIFY_EXPIRE verify expire time in seconds.
  • TUT_VID Verification tutorial video link. eg: https://t.me/How_to_Download_7x/32

Extra Variables

  • CUSTOM_CAPTION put your Custom caption text if you want Setup Custom Caption, you can use HTML for formatting (only for documents)
  • DISABLE_CHANNEL_BUTTON Put True to Disable Channel Share Button, Default if False
  • BOT_STATS_TEXT put your custom text for stats command, use HTML
  • USER_REPLY_TEXT put your text to show when user sends any message, use HTML

Fillings

START_MESSAGE | FORCE_SUB_MESSAGE

  • {first} - User first name
  • {last} - User last name
  • {id} - User ID
  • {mention} - Mention the user
  • {username} - Username

CUSTOM_CAPTION

  • {filename} - file name of the Document
  • {previouscaption} - Original Caption

CUSTOM_STATS

  • {uptime} - Bot Uptime

Required Environment Variables

  • TG_BOT_TOKEN
  • APP_ID
  • API_HASH
  • DB_URL
  • CHANNEL_LINK
  • CHANNEL_ID
  • OWNER_ID
  • OWNER_TAG

Report Bugs, Give Feature Requests at https://github.com/Sachinanand99/File-Sharing-Telegram-bot/issues

Credits

  • Thanks To Dan For His Awsome Libary
  • Thanks to everyone who is on this awesome opensource project.

Star this Repo if you Liked it ⭐⭐⭐

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.4%
  • Other 0.6%