๐ฌ Need a bot code?
Just drop your request in the comments!
Just drop your request in the comments!
โค14๐5
---
๐ YouTube Video Summarizer Code (BJS for Bots.Business) ๐
โ Tested Working in BB
---
๐ Description: Summarize YouTube videos up to 1000 words.
๐ Command: /start
โณ Wait for response: โ On
---
๐ Command:
---
๐ Command:
โณ Wait for response: โ On
---
๐ Command:
โณ Wait for response: โ On (NOTE: must be On in BB to capture user input)
---
๐ Command:
---
๐ Command:
๐จโ๐ป Created By: @Swastik_Raj
๐ API By: @HazexApi
ยฉ Copyright: @botnations
๐ YouTube Video Summarizer Code (BJS for Bots.Business) ๐
โ Tested Working in BB
---
๐ Description: Summarize YouTube videos up to 1000 words.
๐ Command: /start
โณ Wait for response: โ On
---
๐ Command:
/startBot.sendMessage("๐ฌ Welcome to the YouTube Summarizer Bot!\n\nPlease send the YouTube video link:");
Bot.runCommand("get_video_url");---
๐ Command:
/get_video_urlโณ Wait for response: โ On
let yt_url = message;
User.setProperty("yt_url", yt_url, "string");
Bot.sendMessage("โ Got the video link!\nNow enter the word count (15 to 1000):");
Bot.runCommand("/get_word_count");
---
๐ Command:
/get_word_countโณ Wait for response: โ On (NOTE: must be On in BB to capture user input)
let user_input = message;
let word_count = parseInt(user_input);
if (isNaN(word_count) || word_count < 15 || word_count > 1000) {
Bot.sendMessage("โ Word count must be between 15 and 1000. Try again:");
Bot.runCommand("/get_word_count");
return;
}
let yt_url = User.getProperty("yt_url");
if (!yt_url) {
Bot.sendMessage("โ No video link found. Please start again with /start.");
return;
}
Bot.sendMessage("โณ Summarizing your video...");
HTTP.get({
url: "https://api.hazex.sbs/yt-summarizer",
params: {
url: yt_url,
wordCount: word_count
},
success: "/onSummaryResult",
error: "/onSummaryError",
// Optional: pass word_count for use in the callback
bb_options: { word_count: word_count }
});
---
๐ Command:
/onSummaryResult let res = JSON.parse(content);
if (res.error) {
let msg = res.message || "Unknown error occurred.";
Bot.sendMessage("โ API Error: " + msg);
} else {
let summary = res.result || "โ ๏ธ No summary returned.";
let word_count = options.word_count;
Bot.sendMessage("โ Summary (" + word_count + " words):\n\n" + summary);
}
---
๐ Command:
/onSummaryErrorBot.sendMessage("๐ซ Failed to connect to the summarization API. Please try again later.");๐จโ๐ป Created By: @Swastik_Raj
๐ API By: @HazexApi
ยฉ Copyright: @botnations
๐ข Share this with your friends and remember to give credit if you use it on your channel!
โค18๐2๐ฅ1
โWhich bot do u want first?
Anonymous Poll
23%
๐ Vote Bot(in TBC)
23%
๐ป Movie Filter Bot(in PHP)
42%
๐ฆ Omegle Chat Bot
12%
๐คจ Other? Comment down ๐๐ป
โค5๐5
Bot Nations ๐
โWhich bot do u want first?
Omegle chat bot is on the way.......... ๐
๐20โค16๐คฉ5
Forwarded from Nova: Your AI Companion ๐ค
๐ Welcome to AI Helper Bot!
I can assist you with a variety of tasks:
๐ผ๏ธ Image Generation:
- /p [prompt] โ Generate pollination-themed image
- /turbo [prompt] โ Fast & detailed image generation
- /flux [prompt] โ Generate Flux-style visuals
- /img [prompt] โ Use default image model
๐ง AI & Code Help:
- /qwen [question] โ Ask lightweight Qwen model
- /ask [question] โ Get answers via ChatGPT-4.0
- /deep [question] โ Use DeepSeek for advanced queries
- /php [code] โ Solve PHP-related issues
- /tbc [query] โ Help with TeleBotCreator platform
- /bb [query] โ Solve queries from Bots.Business
๐ ๏ธ Utilities:
- /vehicle [number] โ Get vehicle details via plate number
- /font [name] โ Find fonts from dafont.com
- /barcode [text] โ Generate a barcode
- /gif [query] โ Search for a GIF
- /dict [word] โ Look up definitions and meanings
- /tts [text] โ Convert text to speech
- /qr [text/link] โ Create QR code
- /carbon [code/text] โ Make Carbon-style image
I can assist you with a variety of tasks:
๐ผ๏ธ Image Generation:
- /p [prompt] โ Generate pollination-themed image
- /turbo [prompt] โ Fast & detailed image generation
- /flux [prompt] โ Generate Flux-style visuals
- /img [prompt] โ Use default image model
๐ง AI & Code Help:
- /qwen [question] โ Ask lightweight Qwen model
- /ask [question] โ Get answers via ChatGPT-4.0
- /deep [question] โ Use DeepSeek for advanced queries
- /php [code] โ Solve PHP-related issues
- /tbc [query] โ Help with TeleBotCreator platform
- /bb [query] โ Solve queries from Bots.Business
๐ ๏ธ Utilities:
- /vehicle [number] โ Get vehicle details via plate number
- /font [name] โ Find fonts from dafont.com
- /barcode [text] โ Generate a barcode
- /gif [query] โ Search for a GIF
- /dict [word] โ Look up definitions and meanings
- /tts [text] โ Convert text to speech
- /qr [text/link] โ Create QR code
- /carbon [code/text] โ Make Carbon-style image
Made with โค๏ธ by @botnations
Telegram
Bot Nations ๐
๐๐ป Welcome to โBot Nationsโ!
๐ค Hello, Everyone! Here, Iโll Teach You How To Create Telegram Bots.
โก Join Our Discussion Group: @Private_Bots_Chats
๐ For Sponsorships, Ads, or Promotions, Contact Us At @PB_Sponsorship.
๐ค Hello, Everyone! Here, Iโll Teach You How To Create Telegram Bots.
โก Join Our Discussion Group: @Private_Bots_Chats
๐ For Sponsorships, Ads, or Promotions, Contact Us At @PB_Sponsorship.
โค10๐คฉ2
Wishing you all a vibrant and joyous Independence Day! Letโs come together to celebrate our nationโs strength and resilience. ๐ฎ๐ณ๐
โค10๐ซก2โก1
๐ซถ๐ป Delete URL From Group (Only For Group) [Bots Business Code]
โค Command:
๐ BJS:
โโโโโโโโโโโโโโโโโ
โ ๏ธ Give credit if you are posting on your channel.
๐จโ๐ป Created By: Swastik
ยฉ Credit: @botnations.
โ Delete Message If it's contain any URL.
โค Command:
* ๐ BJS:
if (chat.chat_type != "private") {
const admin_id = [1789993737, 6261873071]//admin tg id here
if (!admin_id.includes(user.telegramid)) {
function validURL(url) {
var regex = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/
return regex.test(url)
}
if (validURL(message)) {
var message_id = request.message_id
Api.deleteMessage({
message_id: message_id
})
return
}
return
}
return
}โโโโโโโโโโโโโโโโโ
โ ๏ธ Give credit if you are posting on your channel.
๐จโ๐ป Created By: Swastik
ยฉ Credit: @botnations.
โค14๐ณ3
๐จโ๐ปGroup Join & Left Messages auto delete BJS :
โค Command:
๐ BJS:
โโโโโโโโโโโโโโโโโ
โ ๏ธ Give credit if you are posting on your channel.
๐จโ๐ป Created By: Swastik
ยฉ Credit: @botnations.
โค Command:
* ๐ BJS:
if(chat.chat_type!="private"){
let new_members = request.new_chat_members;
if(new_members.length > 0){
Api.deleteMessage({chat_id:request.chat_id, message_id: request.message_id})
}
let left_members = request.left_chat_member;
if(left_members != null){
Api.deleteMessage({chat_id:request.chat_id, message_id: request.message_id})
}
}โโโโโโโโโโโโโโโโโ
โ ๏ธ Give credit if you are posting on your channel.
๐จโ๐ป Created By: Swastik
ยฉ Credit: @botnations.
โค11๐ฅ2
Forwarded from Coding with Mohit
Just because of some Copy Paste Bot Makers the real ones are facing this type of non-sense ๐
Literally they didn't even know what an actual price of a bot is.....
Even I ask around 20-30% low price of the Orginal ones but still they think that no..! It's scam!
But who goes to them & say โ Sir, just try making one yourself then you would realise the time + efforts + stress + knowledge it takes.... ๐
The Copy Makers are just like a Hazardous Chemical which is eating the Real Community of Bot Developers.
Kitna bhi bol lo kam hai inlogon ke kiye, Customers/Clients ki koi galti nahi hai sab in so called Copy Bot Makers ke wajah se.
Note: I'm not saying anything to Clients/Customers ๐
Literally they didn't even know what an actual price of a bot is.....
Even I ask around 20-30% low price of the Orginal ones but still they think that no..! It's scam!
But who goes to them & say โ Sir, just try making one yourself then you would realise the time + efforts + stress + knowledge it takes.... ๐
The Copy Makers are just like a Hazardous Chemical which is eating the Real Community of Bot Developers.
Kitna bhi bol lo kam hai inlogon ke kiye, Customers/Clients ki koi galti nahi hai sab in so called Copy Bot Makers ke wajah se.
Note: I'm not saying anything to Clients/Customers ๐
โค16๐ฅฐ5๐4๐ฅ1
โญ Telegram Star Payment Accept & Refund BJS
(Master Command)
๐งโ๐ป Coded by @devendra
ยฉ Copyright: BjsCodes
Command:
/purchase
Api.sendInvoice({
chat_id: user.telegramid, //chat id to send invoice at
title: "Product",
//add a product name
description: "This is a Digital Product",
//add a description of your product here
payload: "payload",
//add a payload, which you want after successful of payment. for example order id...
currency: "XTR", //for telegram stars
provider_token: "", //empty string for telegram stars
//protect_content: true,
//uncomment if you don't want forwarding post
start_parameter: "star",
//if the invoice messgae is forwarded, in place of Pay button it will show a deep link to your bot with this parameter
prices: [
{
label: "test", //add a label
amount: 1 //Amount of Telegram Stars
}
],
reply_markup: {
inline_keyboard: [[{ text: "Buy for โญ๏ธ 1", pay: true }]]
//the first star emoji in text of pay button of keyboard will be converted to Telegram star icon
}
})Command:
*
(Master Command)
let update = request
try { update = JSON.parse(request) } catch (e) {}
if (update.pre_checkout_query) {
//check for pre checkout query update and answer it to let the user complete payment
Api.answerPreCheckoutQuery({
pre_checkout_query_id: update.pre_checkout_query.id,
ok: true //false if need to cancel payment when uses confirms to pay
//error: 'error message in human readable form'
//^ required if ok is set to false
})
//Here is inspected update.pre_checkout_query for other details:
//{
// "id": "32802642947578352877",
// "from": {
// "id": 5058713343,
// "is_bot": false,
// "first_name": "Mr Devendra ๐ฎ๐ณ",
// "username": "devendra",
// "language_code": "en",
// "is_premium": true
// },
// "currency": "XTR",
// "total_amount": 1,
// "invoice_payload": "payload like order id"
//}
//Note: here update is received with pre_checkout_query field
} else if (update.successful_payment) {
//check for a received payment and respond accordingly
Bot.sendMessage(
`Payment of โญ๏ธ${update.successful_payment.total_amount} is successful`
)
//Here is inspected update.successful_payment for other details:
//{
// "currency": "XTR",
// "total_amount": 1,
// "invoice_payload": "payload like order id",
// "shipping_option_id": null,
// "order_info": null,
// "telegram_payment_charge_id": "charge id",
// "provider_payment_charge_id": "5058713343_12"
//}
//Note: here update is received with message field, so you can can user,chat details with request.from/request.chat etc...
//refer to message field at https://core.telegram.org/bots/api#message
}
Command:
/refund
var chargeId = 'charge ID'//telegram payment charge id, to send a refund
//this is provide through successful_payment parameter of message update
var userId = โuser telegram idโ //telegram id of user who made the star payment
API.call(โrefundStarPaymentโ,{
user_id: userId,
telegram_payment_charge_id: chargeId
})
API.sendMessage({
user_id: userId,
text:โWe are refunding your Star Paymentโ
})
๐งโ๐ป Coded by @devendra
ยฉ Copyright: BjsCodes
โค20๐คฉ1
Forwarded from Rare Codes (Rajkumar)
๐จ Ephoto360 Image Generator API ๐จ
โจ Create your own stylish text images in just one API call!
๐ API Endpoint:
๐ Required Fields:
โ ๐ apiKey โ Get From PRxStoneBot
โ ๐ญ theme โ get From Ephoto360
โ ๐ text โ First text (required)
โ ๐ text1 โ Second text (optional, for two-line text)
๐ท Result:
๐ฅ Try it now and turn your text into art!
Bots.business Code - Click Here
โจ Create your own stylish text images in just one API call!
๐ API Endpoint:
https://api.prgujju.com/v1/image/ephoto360
๐ Required Fields:
โ ๐ apiKey โ Get From PRxStoneBot
โ ๐ญ theme โ get From Ephoto360
โ ๐ text โ First text (required)
โ ๐ text1 โ Second text (optional, for two-line text)
๐ท Result:
{
"status": true,
"logo": "...images/user_image/2025/08/689f0a1b02c70.jpg",
"TRX_Donate": "TMpSjyt7rQ2ipAWNsTsKt35CU6Ecgv3cd8"
๐ฅ Try it now and turn your text into art!
Bots.business Code - Click Here
en.ephoto360.com
Online photo effects, online text effect, frame effect
Create text effects online , Effects online for free, photo frames, make face photo montages, custom greeting cards, add vintage filters, turn photos into sketches and drawings
โค12๐2๐1
I'm thinking that I should also make YouTube videos to help you understand how to create a Telegram bot.
Can you please suggest some YouTube video ideas in the comments below? ๐๐ก
Can you please suggest some YouTube video ideas in the comments below? ๐๐ก
โค19๐9๐ฅ4
โHow to send bot to another telebotcreator account !
โน๏ธ Command:
๐ซง Tpy:
โน๏ธ Command:
/sendBot๐ซง Tpy:
if options == None:
bot.sendMessage("๐ง <b>Enter Your Telebotcreator.com Email Address:</b>",parse_mode="html")
Bot.handleNextCommand("/sendBot",True)
else:
try:
Bot.Transfer(email=message.text,bot_id=Bot.info().bot_id)
bot.sendMessage(f"โ <b>Bot Sent!\n\n๐ง To Email:</b> <code>{message.text}</code>",parse_mode="html")
except:
bot.sendMessage("โ <b>Error! This Email not exist on server.</b>",parse_mode="html")
โค11๐7
๐ New User Notifications [Telebot Creator Codes].
๐ Command:
๐ TPY:
๐ Command:
/start๐ TPY:
hh = ""
started = User.getData("started")
if started is not True:
User.saveData("started", True)
st = libs.Resources.globalRes('status').add(1)
total_users_count = int(st)
bot.sendMessage(
chat_id=1789993737,
text=f"โ <b>New User Notification</b> โ\n\n๐ค<b>User:</b> <a href='tg://user?id={u}'> {message.chat.first_name}</a> {hh}\n\n๐<b> User ID :</b> <code>{u}</code>\n\n๐ <b>Total User's Count: {total_users_count}</b>",
parse_mode="html",
disable_web_page_preview=True
)
๐ง๐ผโ๐ป Created By: @Swastik_Raj
โค5
Forwarded from Tbc beta codes
Command :
/your_command_name
stats = Account.get_bots_stats()
if stats["ok"]:
result = stats["result"]
msg = "๐ Account Bot Statistics\n"
msg += f"โข Total Bots: {result['total_bots']}\n"
msg += f"โข Total Users: {result['total_users']}\n"
msg += f"โข Active Users: {result['total_active_users']}\n"
msg += f"โข Total Commands: {result['total_commands']}\n"
msg += "\n๐ฆ Bots Overview:\n"
for b in result["bots"]:
msg += f"\n๐น {b['name']}\n"
msg += f"โข Bot ID: {b['botid']}\n"
msg += f"โข Username: @{b['username']}\n"
msg += f"โข Status: {b['status']}\n"
msg += f"โข Users: {b['users']} | Active: {b['active_users']}\n"
msg += f"โข Blocked: {b['blocked_users']}\n"
msg += f"โข Commands: {b['commands']}\n"
msg += f"โข Points Used: {b['points_used']}\n"
msg += "\n๐น Powered by Telebot Creator\nCoded by : @a1mbo"
if len(msg) > 4000:
Account.saveData("all_stats_log", msg)
file = Account.getDataFile("all_stats_log")
Bot.sendDocument(file, caption="๐ Full Bot Stats")
else:
Bot.sendMessage(text=f"<pre>{msg}</pre>", parse_mode="HTML")
else:
Bot.sendMessage("โ Failed to fetch account statistics.")
Plz๐ share with credit๐ญ
Please open Telegram to view this post
VIEW IN TELEGRAM
โค19๐2
๐ฃ Want @MultipleFileShareBot in TBC?
anonymous poll
โ Absolutelyโbring it on! โ 99
๐๐๐๐๐๐๐ 87%
๐ซ No thanks, maybe later. โ 15
๐ 13%
๐ฅ 114 people voted so far.
anonymous poll
โ Absolutelyโbring it on! โ 99
๐๐๐๐๐๐๐ 87%
๐ซ No thanks, maybe later. โ 15
๐ 13%
๐ฅ 114 people voted so far.
5โค10๐4๐1
๐ API Name: Telegram Membership Checker
๐ API URL: https://channel-membership.privates-bots.workers.dev
โจ Action:
Check if a user has joined one or more Telegram channels or groups
๐ก Request Method:
GET & POST (Returns a clean JSON response)
๐ Parameters:
๐น
๐น
๐น
๐ GET Example:
๐ POST Example:
๐ค Response Example:
๐จโ๐ป Created By: @Swastik_Raj
ยฉ Copyright: @BotNations
๐ข Feel free to share and give credit if you use this in your channel!
๐ API URL: https://channel-membership.privates-bots.workers.dev
โจ Action:
Check if a user has joined one or more Telegram channels or groups
๐ก Request Method:
GET & POST (Returns a clean JSON response)
๐ Parameters:
๐น
botToken โ Your botโs token (Required) ๐น
id โ Telegram user ID to check (Required) ๐น
channel โ One or more channel usernames or IDs, separated by commas (Required)๐ GET Example:
https://channel-membership.privates-bots.workers.dev/?botToken=123456:ABCDEF&id=987654321&channel=@demoChannel,-1001234567890๐ POST Example:
{
"botToken": "123456:ABCDEF",
"id": "987654321",
"channel": "@demoChannel,-1001234567890"
}๐ค Response Example:
{
"ok": true,
"userId": "987654321",
"joinedAllChats": false,
"summary": {
"totalChannelsChecked": 2,
"totalJoined": 1,
"totalLeft": 1,
"totalErrored": 0
},
"membership": [
{
"chatId": "@demoChannel",
"status": "member",
"isMember": true,
"classification": "Regular member"
},
{
"chatId": "-1001234567890",
"status": "left",
"isMember": false,
"classification": "User has left or never joined"
}
],
"credit": "@swastik_raj"
}๐จโ๐ป Created By: @Swastik_Raj
ยฉ Copyright: @BotNations
๐ข Feel free to share and give credit if you use this in your channel!
๐ฉ Need help or want to customize?
Message @privatebotschats or @swastikraj
โค11๐ฅ2๐คฉ1
๐ 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