Telegram’s Fastest File-to-Link Bot with Multiple Advanced Features
Seamlessly convert files to links for streaming and downloading, powered by Pyrogram.
🐞 Report a Bug | 🌟 Request a Feature
📋 Table of Contents
- Streamlined Code: Improved efficiency by eliminating redundant processes.
- High Speed: Powered by Pyrogram for optimized performance.
- Easy Deployment: Pre-configured for hassle-free setup.
- Enhanced Functionality:
- 😄 User-Friendly Interface
- 🔗 Instant Stream Links
- 👥 Group Support
- 📂 Batch Processing with Custom Commands: Reply to the first file of a batch with
/link <batch_number>
(e.g.,/link 23
). - 📢 Channel Support
- 📑 Log Channel for Tracking Activities
- 🚨 Admin Broadcast Capabilities
View All Commands (Click to expand)
/start - Start the bot
/link - Generate a stream link
/help - Bot usage details
/about - Get bot information
/dc - Check data center details
/ping - Check bot latency
/stats - (Admin) View bot usage statistics
/status - (Admin) Check bot operational status
/broadcast - (Admin) Send messages to all users
/users - (Admin) View the total number of users
Press the button below to deploy on Heroku:
Then, refer to the variables tab for more info on setting up environmental variables.
git clone https://github.com/fyaz05/FileToLink
cd FileToLink
pip3 install -r requirements.txt
python3 -m Thunder
To stop the bot:
Ctrl + C
If you want to run the bot 24/7 on VPS:
sudo apt install tmux -y
tmux
python3 -m Thunder
Now you can close the VPS, and the bot will keep running.
If you're on Heroku, just add these to the Environmental Variables. If you're hosting locally, create a .env
file in the root directory and add all the variables there. Example .env
file:
API_ID=
API_HASH=
BOT_TOKEN=
BIN_CHANNEL=
DATABASE_URL=
FQDN=
HAS_SSL=
OWNER_ID=
OWNER_USERNAME=
PORT=
#Remove hash for using multiple tokens and max token up to 49
#MULTI_TOKEN1=
#MULTI_TOKEN2=
#MULTI_TOKEN3=
API_ID
: Get it from my.telegram.org.API_HASH
: Get it from my.telegram.org.BOT_TOKEN
: Get the bot token from @BotFather.BIN_CHANNEL
: Create a new channel (private/public), post something in your channel, forward that post to @missrose_bot, and reply with/id
. Copy the forwarded channel ID here.OWNER_ID
: Your Telegram User ID. Send/id
to @missrose_bot to get it.DATABASE_URL
: MongoDB URI for saving user IDs for broadcasting.
UPDATES_CHANNEL
: Public channel username that users must join to use the bot. Ensure bot is an admin there.
BANNED_CHANNELS
: IDs of channels where the bot won't work. Separate multiple IDs with a Space.
SLEEP_THRESHOLD
: Time (in seconds) for bot to handle flood wait exceptions automatically. Defaults to 60 seconds.
WORKERS
: Max number of concurrent workers for updates. Defaults to 3
.
PORT
: The port for your web app's deployment. Defaults to 8080
.
MY_PASS
: Bot PASSWORD.
WEB_SERVER_BIND_ADDRESS
: Your server's bind address. Defaults to 0.0.0.0
.
NO_PORT
: Set your PORT
to 80
(http) or 443
(https) if you want the port hidden. Ignore if using Heroku.
FQDN
: A Fully Qualified Domain Name, if present. Defaults to WEB_SERVER_BIND_ADDRESS
.
BIN_CHANNEL
as admins.
/start
: Check if the bot is active.- To get an instant stream link, forward any media to the bot.
- To use in a group, add the bot as admin and reply to a file with /link.
-
How long do the links remain valid?
Links remain valid as long as your bot is running and you haven't deleted the log channel.
Feel free to contribute to this project if you have any ideas or improvements in mind!
- Me
- Adarsh Goel