π Multiple File Sharing Telegram Bot [TELEBOT CODES]
β€οΈβπ₯ Command:
/start π TPY:
if not params or params == "None":
bot.sendMessage(
text=(
"<b>π€ Welcome to Multi File Sharing Bot!</b>\n\n"
"With this bot, you can:\n"
"β’ Upload <b>multiple photos, videos, documents, stickers, audios, voices, animations</b>.\n"
"β’ Get a <b>unique shareable link</b> for your uploaded files.\n"
"β’ Share that link anywhere, and anyone can open it to view/download your files.\n\n"
"β‘ <b>How to use:</b>\n"
"1. Type <code>/upload</code> to start an upload session.\n"
"2. Send all your media files one by one.\n"
"3. When finished, type β to confirm upload.\n"
"4. You will get a shareable link to your uploaded files.\n\n"
"β³ Files shared in chat are <b>auto-deleted after 10 minutes</b> to prevent spam.\n"
"But donβt worry β you can always restore them using the shareable link.\n\n"
"π Start sharing your files now!"
),
parse_mode="html",
reply_markup={
"inline_keyboard": [[
{"text": "π€ Start Uploading", "callback_data": "/upload"}
]]
}
)
else:
media_id = params
files = Bot.getData(media_id)
if not files:
bot.sendMessage("β No media found for this link.")
else:
sent_msgs = [] # store message IDs for later deletion
# Send all media
for f in files:
m = None
if f["type"] == "photo":
m = bot.sendPhoto(f["file_id"], caption=f.get("caption", ""))
elif f["type"] == "video":
m = bot.sendVideo(f["file_id"], caption=f.get("caption", ""))
elif f["type"] == "audio":
m = bot.sendAudio(f["file_id"])
elif f["type"] == "voice":
m = bot.sendVoice(f["file_id"])
elif f["type"] == "document":
m = bot.sendDocument(f["file_id"])
elif f["type"] == "animation":
m = bot.sendAnimation(f["file_id"])
elif f["type"] == "sticker":
m = bot.sendSticker(f["file_id"])
if m and "message_id" in m:
sent_msgs.append(m["message_id"])
# Final note
note = bot.sendMessage(
"β οΈ <b>Note:</b> Files will be automatically deleted from chat after <b>10 minutes</b> to prevent spam.",
parse_mode="html",
reply_markup={
"inline_keyboard": [[
{"text": "π Join Channel", "url": "t.me/botnations"}
]]
}
)
if "message_id" in note:
sent_msgs.append(note["message_id"])
# Schedule deletion of messages only
Bot.runCommandAfter(
600,
"/delete_messages",
options={"user_id": message.chat.id, "message_ids": sent_msgs, "media_id": media_id}
)
β€οΈβπ₯ Command:
/upload π TPY:
# /upload command
keyboard = ReplyKeyboardMarkup(True)
keyboard.row("β ")
media_id = Bot.genId() # generate a unique ID
bot.sendMessage(chat_id=message.chat.id, text="π Send me the text you want to upload. When you are done.",reply_markup = keyboard)
Bot.handleNextCommand("/handle_media", options={"media_id": media_id, "files": []}) # initialize files as an empty list
β€οΈβπ₯ Command:
/handle_mediaπ TPY:
β€14π4π€©2π1
media_id = options.get("media_id")
files = options.get("files", [])
keyboard = ReplyKeyboardRemove()
if message.text == "β
":
# Confirmation Logic
if files:
shareable_link = f"https://t.me/{Bot.info().username}?start={media_id}"
bot.sendMessage(
chat_id=message.chat.id,
text=f"β
Upload complete!\nShare this link:\n{shareable_link}",
reply_markup=keyboard
)
Bot.saveData(media_id, files) # Save to DB
else:
bot.sendMessage(chat_id=message.chat.id, text="β No media was uploaded.")
else:
media_entry = None
if message.photo:
media_entry = {"type": "photo", "file_id": message.photo[-1]["file_id"], "caption": message.caption or ""}
elif message.video:
media_entry = {"type": "video", "file_id": message.video["file_id"], "caption": message.caption or ""}
elif message.audio:
media_entry = {"type": "audio", "file_id": message.audio["file_id"]}
elif message.voice:
media_entry = {"type": "voice", "file_id": message.voice["file_id"]}
elif message.document:
media_entry = {"type": "document", "file_id": message.document["file_id"]}
elif message.animation:
media_entry = {"type": "animation", "file_id": message.animation["file_id"]}
elif message.sticker:
media_entry = {"type": "sticker", "file_id": message.sticker["file_id"]}
if media_entry:
files.append(media_entry)
bot.sendMessage(chat_id=message.chat.id, text="β
Media saved. Send more or type β
to finish.")
else:
bot.sendMessage(chat_id=message.chat.id, text="β Unsupported input. Please send media files only.")
# Loop until user confirms
Bot.handleNextCommand("/handle_media", options={"media_id": media_id, "files": files})β€οΈβπ₯ Command:
/delete_messagesπ TPY:
user_id = options.get("user_id")
msg_ids = options.get("message_ids", [])
media_id = options.get("media_id")
# Delete all sent messages
for mid in msg_ids:
try:
bot.deleteMessage(chat_id=user_id, message_id=mid)
except Exception:
pass
# Notify user with restore option
Bot.sendMessage(
chat_id=user_id,
text="ποΈ Your files have been deleted from chat after 10 minutes.\nClick below to restore them.",
reply_markup={
"inline_keyboard": [[
{"text": "π Restore Files", "url": f"https://t.me/{Bot.info().username}?start={media_id}"}
]]
}
)π¨βπ» Created By: @Swastik_Raj
Β© Copyright: @BotNations
π’ Feel free to share and give credit if you use this in your channel!
β€14π4π2π₯°1
Bot Nations π
media_id = options.get("media_id") files = options.get("files", []) keyboard = ReplyKeyboardRemove() if message.text == "β
": # Confirmation Logic if files: shareable_link = f"https://t.me/{Bot.info().username}?start={media_id}" bot.sendMessage(β¦
YouTube
π Build Your Own Multiple File Sharing Telegram Bot Easily! π€ | Privates Bots
π Build Your Own Multiple File Sharing Telegram Bot Easily! π€ | Privates Bots
In this step-by-step tutorial, learn how to create a Multiple File Sharing Telegram Bot that lets users share multiple media files through a single link β fast, secure, and endβ¦
In this step-by-step tutorial, learn how to create a Multiple File Sharing Telegram Bot that lets users share multiple media files through a single link β fast, secure, and endβ¦
β€3π2β€βπ₯1
π Introducing Code Formatter β Your Go-To Solution for Clean Code!
π Visit Us Now: https://code-formating.vercel.app
β¨ Supports Python, JS, Ruby, C#, and more
π¨ Custom themes & beginner-friendly interface
π Private, secure, and lightning-fast
π Visit Us Now: https://code-formating.vercel.app
π£ Love it? Share it with your friends and colleagues!
β€8π―3π2
π‘οΈ Channel Membership Verification Bot [TELEBOT CODES]
β€οΈβπ₯ Command:
π TPY:
β οΈ Give credit if you are posting on your channel.
π¨βπ» Created By: @swastik_raj
Β© Credit: @botnations
π Purpose: Check if a user has joined required channels.
β€οΈβπ₯ Command:
/verifyπ TPY:
# Command: /verify
try:
# Define your channels here (can be 1 or more)
channels = ["@botnations", "-1001687277105"]
bot_token = str(Bot.info().token)
# Send "checking..." message and save message_id for later editing
checking = bot.sendMessage("π Checking your channel membership status, please wait...")
# Build the API URL dynamically using the channels list
api_url = f"https://channel-membership.privates-bots.workers.dev/?botToken={bot_token}&id={u}&channel={','.join(channels)}"
# Make HTTP request
response = HTTP.get(api_url)
data = bunchify(response.json())
# Prepare message content
if data.ok == True:
summary = data.summary
joined = summary.totalJoined
total = summary.totalChannelsChecked
left = summary.totalLeft
text = f"<b>π Membership Summary</b>\n\n"
text += f"π€ User ID: <code>{u}</code>\n"
text += f"β Joined: <b>{joined}</b> / {total}\n"
text += f"π« Left: <b>{left}</b>\n\n"
text += "<b>π¦ Detailed Status:</b>\n"
for ch in data.membership:
status_emoji = "β " if ch.isMember else "β"
text += f"{status_emoji} <b>{ch.chatId}</b> - {ch.classification}\n"
if data.joinedAllChats == True:
text += "\nπ You have joined all required channels!"
else:
text += "\nβ οΈ Please join all required channels to continue."
# Edit previous message with the result
bot.editMessageText(text=text, chat_id=message.chat.id, message_id=checking.message_id, parse_mode="html")
else:
bot.editMessageText(text="β Failed to verify membership. Please try again later.", chat_id=message.chat.id, message_id=checking.message_id)
except Exception as e:
bot.editMessageText(text=f"β οΈ Error occurred: {str(e)}", chat_id=message.chat.id, message_id=checking.message_id)
β οΈ Give credit if you are posting on your channel.
π¨βπ» Created By: @swastik_raj
Β© Credit: @botnations
β€13β€βπ₯2π2π₯2
Bot Nations π
π‘οΈ Channel Membership Verification Bot [TELEBOT CODES] π Purpose: Check if a user has joined required channels. β€οΈβπ₯ Command: /verify π TPY: # Command: /verify try: # Define your channels here (can be 1 or more) channels = ["@botnations", "-1001687277105"]β¦
YouTube
β
Membership Verification Telegram Bot | Privates Bots
β
Membership Verification Telegram Bot Easily! π€ | Privates Bots
In this detailed step-by-step tutorial, learn how to create a **Membership Verification Telegram Bot** that automatically checks if users are members of your added channels before givingβ¦
In this detailed step-by-step tutorial, learn how to create a **Membership Verification Telegram Bot** that automatically checks if users are members of your added channels before givingβ¦
β€7π2
I am thinking of starting to do some videos to help people who want to legitimately be able to codeβ most seems like copy paste without any knowledge about the concept.
3β€15π€©5
π‘ Handling βMessage too longβ Error
βοΈ Telegram allows sending a Text message of max 4096 characters by bot
π‘ Send Message in multiple messages chunks.
Here is the BJS code to do that:
π§βπ» Coded by: @devendra
Β© Copyright: @BjsCodes
βοΈ Telegram allows sending a Text message of max 4096 characters by bot
π‘ Send Message in multiple messages chunks.
Here is the BJS code to do that:
let chatId = chat.chatid; // Replace with chat id
let message = 'Long Message to sendβ¦'; // Replace with the long message
// Function to split a long message into smaller pieces/chunks
function splitMessage(message, maxLength = 4096) {
let chunks = []
// Split the message in multiple chunks each of max 4096 characters
for (let i = 0; i < message.length; i += maxLength) {
chunks.push(message.substring(i, Math.min(message.length, i + maxLength)))
}
return chunks;
}
// Function to send a long message in smaller pieces
function sendMessageInChunks(chatId, text) {
// split the message into chunks
var chunks = splitMessage(text)
// Send the pieces of chunks one after other
for (let i = 0; i < chunks.length; i++) {
Api.sendMessage({ chat_id: chatId, text: chunks[i] })
}
}
// Send the message in pieces
sendMessageInChunks(chatId, message)
π§βπ» Coded by: @devendra
Β© Copyright: @BjsCodes
βοΈ Only use in state of high requirement, else BB server may get load.
β€9π1π1
Bot Nations π
Want this bot tutorial? @PerplexitySRoBot
Real time information!
Text to video
Image Editing & much more
Text to video
Image Editing & much more
β€9π₯6π3
Bot Nations π
https://youtu.be/qT367lglThQ
You can clone the @PerplexitySRoBot from the above video!
β€8π2
β€8π€©1
ππΌ Hello BotMakers!
Iβm working on my next YouTube videoβand itβs all about how you can start earning $50β$100/month by monetizing your Telegram bot π°
Stay tunedβand donβt forget to subscribe so you donβt miss it! ππ₯
Iβm working on my next YouTube videoβand itβs all about how you can start earning $50β$100/month by monetizing your Telegram bot π°
Stay tunedβand donβt forget to subscribe so you donβt miss it! ππ₯
β€15β‘4π₯4π2π2β€βπ₯1π1
Bot Nations π
ππΌ Hello BotMakers! Iβm working on my next YouTube videoβand itβs all about how you can start earning $50β$100/month by monetizing your Telegram bot π° Stay tunedβand donβt forget to subscribe so you donβt miss it! ππ₯
Here's the video
https://youtu.be/m9INAwGkbPI
https://youtu.be/m9INAwGkbPI
π6β€5
Bot Nations π
Here's the video https://youtu.be/m9INAwGkbPI
Hit the like button ππΌ
Nd leave a comment π«ΆπΌ
Nd leave a comment π«ΆπΌ
β€11π₯°4