file-sharing-token-bot
file-sharing-token-bot copied to clipboard
Telegram Bot to store Posts and Documents and it can Access by Special Links
📁 File Sharing Token Bot
Telegram Bot to store posts and documents accessible via special links.
🚀 Overview
File Sharing Token Bot is a Telegram bot designed to store posts and documents, accessible through special links. This bot provides a convenient way to manage and share content within Telegram.
✨ Features
- Store posts and documents.
- Access content via special links.
- Easy to deploy and customize.
- Token Verifiction
- Auto Deletion
🛠️ Setup
To deploy the bot, follow these steps:
- Add the bot to a database channel with all permissions.
- Add the bot to the ForceSub channel as an admin with "Invite Users via Link" permission if ForceSub is enabled.
📦 Installation
Deploy on Heroku
Click the button below to deploy the bot on Heroku:
For a detailed deployment guide, watch this tutorial video.
Deploy on Railway
Deploy on Koyeb
Click the button below to deploy the bot on Koyeb:
Deploy on Your VPS
git clone https://github.com/sahildesai07/file-sharing-token-bot
cd file-sharing-token-bot
pip3 install -r requirements.txt
# <Create config.py appropriately>
python3 main.py
Deploy on VPS
Prerequisites
1. Installing requirements
- Clone this repo:
git clone https://github.com/sahildesai07/file-sharing-token-bot/ && cd file-sharing-token-bot
- For Debian based distros
sudo apt install python3 python3-pip
Install Docker by following the Official docker docs.
Or you can use the convenience script: curl -fsSL https://get.docker.com | bash
- For Arch and it's derivatives:
sudo pacman -S docker python
2. Build And Run the Docker Image
Make sure you still mount the app folder and installed the docker from official documentation.
- There are two methods to build and run the docker:
- Using official docker commands.
- Using docker-compose.
Build And Run The Docker Image Using Official Docker Commands
- Start Docker daemon (SKIP if already running, mostly you don't need to do this):
sudo dockerd
- Build Docker image:
sudo docker build . -t uxbbot
- Run the image:
sudo docker run -p 80:80 -p 8080:8080 uxbbot
- To stop the running image:
sudo docker ps
sudo docker stop id
Build And Run The Docker Image Using docker-compose
NOTE: If you want to use ports other than 80 and 8080 change it in docker-compose.yml.
- Install docker compose
sudo apt install docker-compose
- Build and run Docker image:
sudo docker-compose up --build
- To stop the running image:
sudo docker-compose stop
- To run the image:
sudo docker-compose start
- To get latest log from already running image (after mounting the folder):
sudo docker-compose up
Cmd to start the Bot: bash start.sh 🔧 Admin Commands
start - start the bot or get posts
batch - create link for more than one posts
genlink - create link for one post
users - view bot statistics
broadcast - broadcast any messages to bot users
stats - checking your bot uptime
🛠️ Variables
API_HASHYour API Hash from my.telegram.orgAPP_IDYour API ID from my.telegram.orgTG_BOT_TOKENYour bot token from @BotFatherOWNER_IDMust enter Your Telegram IdCHANNEL_IDYour Channel ID eg:- -100xxxxxxxxDB_URIYour mongo db url tutorial video.DB_nameYour mongo db session name ( random )ADMINSOptional: A space separated list of user_ids of Admins, they can only create linksSTART_MESSAGEOptional: start message of bot, use HTML and fillingsFORCE_SUB_MESSAGEOptional:Force sub message of bot, use HTML and FillingsFORCE_SUB_CHANNELOptional: ForceSub Channel ID, leave 0 if you want disable force subPROTECT_CONTENTOptional: True if you need to prevent files from forwarding
Extra Variables
CUSTOM_CAPTIONput your Custom caption text if you want Setup Custom Caption, you can use HTML and fillings for formatting (only for documents)DISABLE_CHANNEL_BUTTONPut True to Disable Channel Share Button, Default if FalseBOT_STATS_TEXTput your custom text for stats command, use HTML and fillingsUSER_REPLY_TEXTput your text to show when user sends any message, use HTML
Token Variables
IS_VERIFY= Default : "True" (if you want off : False )SHORTLINK_URL= Your shortner Url ( ex. "api.shareus.io")SHORTLINK_API= Your shortner API (ex. "PUIAQBIFrydvLhIzAOeGV8yZppu2")VERIFY_EXPIRE= ( ex. 86400)) # Add time in seconds
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
💬 Support Join Our Telegram Group For Support/Assistance And Our Channel For Updates.
Report Bugs, Give Feature Requests There..
🎉 Credits
Thanks to Dan for his awesome library. Libary Our support group members.
FILE-SHARING-BOT is Free Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Star this Repo if you Liked it ⭐⭐⭐
