Skip to content

keep your channels safe from copyright issues while sharing links in a simple and secure manner. If you just want to ensure that your content stays protected, this bot has got your back! ๐Ÿ’ช

License

Notifications You must be signed in to change notification settings

Codeflix-Bots/Links-Share-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

45 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒŸ What is LinkShareBot?

LinkShareBot is a modern Telegram bot that allows you to share and manage unlimited Telegram channel links with automatic invite link generation and management.

Powered by Pyrogram, it provides a seamless experience for users to join channels through secure, auto-expiring links. The bot includes advanced features like force subscription, bulk link generation, and request link management.

๐Ÿš€ Features

๐ŸŒŸ Feature ๐Ÿ”Ž Description
๐Ÿ“บ Unlimited Channels Add and manage unlimited Telegram channels
๐Ÿ”— Auto Invite Links Generate secure, auto-expiring invite links
โฑ๏ธ Auto Revoke Links automatically revoke after 5 minutes
๐Ÿ“ฆ Bulk Generation Generate links for multiple channels at once
๐Ÿ“‹ Pagination Support Navigate through large channel lists easily
๐Ÿ”„ Request Links Support for join request links
๐Ÿ›ก๏ธ Force Subscription Require users to join specific channels
๐Ÿ“Š Bot Statistics Monitor bot usage and user statistics

๐Ÿ› ๏ธ Commands

Channel & Link Management (Owner/Admins)

  • /addch <channel_id> โ€” Add a channel to the bot (admin only)

  • /delch <channel_id> โ€” Remove a channel from the bot (admin only)

  • /channels โ€” Show all connected channels as buttons (paginated)

  • /reqlink โ€” Show all request links for channels (paginated)

  • /links โ€” Show all channel links as text (paginated)

  • /bulklink <id1> <id2> ... โ€” Generate links for multiple channel IDs at once

  • /channels โ€” Show all connected channel IDs and names (paginated, with next/prev buttons and auto-deleting "please wait..." status)

  • /reqtime โ€” Set the auto-approve request timer duration.

  • /reqmode โ€” Toggle auto request approval mode (ON/OFF).

  • /approveon โ€” Enable auto request approval for a specific channel.

  • /approveoff โ€” Disable auto request approval for a specific channel.

  • /approveall โ€” Approve all pending join requests in a channel using userbot (make sure to fill your session string in approve.py).

Admin Commands

  • /stats โ€” Show bot stats (owner only)
  • /status โ€” Show bot status (admins)
  • /broadcast โ€” Broadcast a message to all users (admins)
  • /cleanup โ€” Remove inactive users from database (admins)

๐Ÿ”‘ Environment Variables

Below are the required and optional environment variables for deployment.

API_ID=              # Required - Get from https://my.telegram.org
API_HASH=            # Required - From https://my.telegram.org
TG_BOT_TOKEN=        # Required - Get from @BotFather
OWNER_ID=            # Required - Your Telegram user ID
ADMINS=              # Required - Admin user IDs (space separated)
DB_URL=              # Required - MongoDB connection string
DB_NAME=             # Optional - MongoDB database name (default: LinkShareBot)
DATABASE_CHANNEL=    # Required - Private channel ID for link storage

โš ๏ธ Never expose raw credentials or tokens in public repos. Use safe paste services like Pastebin or Batbin.

Where do I get each key?
Key Where to Get It Steps Notes
API_ID & API_HASH my.telegram.org โ†’ API Development Tools 1) Log in with Telegram โ†’ 2) Open API Development Tools โ†’ 3) Create app โ†’ 4) Copy values Keep these private. Needed by both userbot & bot client.
TG_BOT_TOKEN @BotFather 1) /newbot โ†’ 2) Set name & username โ†’ 3) Copy the token Rotate if leaked. Store in .env.
OWNER_ID Telegram Profile you own 1) Use @userinfobot or @getmyid_bot โ†’ 2) Send any message to get your ID โ†’ 3) Copy the number Must be a single number (yours).
ADMINS Telegram Profiles of admins 1) Get IDs via @userinfobot โ†’ 2) Add multiple IDs space-separated โ†’ 3) Include OWNER_ID if needed Space-separated list of admin IDs.
DB_URL MongoDB Atlas 1) Create free cluster โ†’ 2) Add database user & IP allowlist โ†’ 3) Copy connection string (mongodb+srv://...) Required for persistence (channels, users, etc.).
DATABASE_CHANNEL Telegram Channel you own 1) Create private channel โ†’ 2) Add your bot as admin โ†’ 3) Get ID via @userinfobot or @getmyid_bot Private channel for link storage.

โ˜• VPS Setup Guide

Toggle VPS Steps

Details
๐ŸŽต Deploy LinkShareBot on VPS

# Step 1: Update & Install Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl python3-pip python3-venv ffmpeg unzip tmux

# Step 2: Clone & Setup
git clone https://github.com/yourusername/LinkShareBot
cd LinkShareBot
tmux new -s LinkShareBot

# Inside tmux:
python3 -m venv venv
source venv/bin/activate
pip install -U pip && pip install -r requirements.txt

# Create .env file with your environment variables
nano .env

# Run the bot
python3 main.py

### Useful Commands
tmux detach                      # Use Ctrl+B, then D
tmux attach-session -t LinkShareBot       # Reattach session
tmux kill-session -t LinkShareBot         # Kill bot session
rm -rf LinkShareBot                # Uninstall bot

๐Ÿณ Docker Deployment

Toggle Docker Steps

Details
### Step 1: Clone Repo
git clone https://github.com/yourusername/LinkShareBot
cd LinkShareBot

### Step 2: Create .env File
nano .env
# Paste your environment variables here and save (Ctrl+O, Enter, Ctrl+X)

### Step 3: Build Image
docker build -t linksharebot .

### Step 4: Run Container
docker run -d --name linkshare --env-file .env --restart unless-stopped linksharebot

### Step 5: Manage Container
docker logs -f linkshare        # View logs (Ctrl+C to exit)
docker stop linkshare           # Stop container
docker start linkshare          # Start again
docker rm -f linkshare          # Remove container
docker rmi linksharebot         # Remove image

โ˜๏ธ Quick Deploy

Platform Deploy Link
๐ŸŒ Heroku Deploy

๐Ÿ’ฌ Community & Support

๐Ÿ”– Credits

  • แด„ส€แด€า“แด›แด‡แด… แดกษชแด›สœ แด˜แด€ssษชแดษด ส™ส สแด€แด›แด

About

keep your channels safe from copyright issues while sharing links in a simple and secure manner. If you just want to ensure that your content stays protected, this bot has got your back! ๐Ÿ’ช

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages