BotVerse by Ravi
156 subscribers
32 photos
4 videos
4 files
63 links
Explore the BotVerse! Updates, insights, and creations from Ravi's world of bots.

Support Chat: @BotVerseRaviSupport
Support Bot: @BotVerseRavi_bot

t.me/boost/BotVerseRavi
Download Telegram
Creating a Link Remover Bot for a Telegram group using PHP


1. Creating a Bot using @BotFather.
2. Adding the Bot to the Group and making it an admin.
3. Using Telegram Bot API to monitor messages and delete those containing links.

Step 1: Create a Bot
• Go to @BotFather and type /newbot.
• Follow the steps and get your bot token.

Step 2: Add the Bot to Your Group
• Add the bot to your Telegram group.
• Promote it to admin with "Delete Messages" permission.

Step 3: Deploy PHP Bot
Save the following script as link_remover_bot.php on your server:

<?php

$botToken = "YOUR_BOT_TOKEN"; // Replace with your bot token
$update = json_decode(file_get_contents("php://input"), true);

if (isset($update['message'])) {
$message = $update['message'];
$chatId = $message['chat']['id'];
$messageId = $message['message_id'];
$text = isset($message['text']) ? $message['text'] : '';

// Regular expression to detect links
if (preg_match('/https?:\/\/|www\./i', $text)) {
deleteMessage($chatId, $messageId);
}
}

// Function to delete a message
function deleteMessage($chatId, $messageId) {
global $botToken;
$url = "https://api.telegram.org/bot$botToken/deleteMessage";

$data = [
'chat_id' => $chatId,
'message_id' => $messageId
];

file_get_contents($url . "?" . http_build_query($data));
}

?>


Step 4: Set Up a Webhook
You need to host the script on a server with HTTPS and set a webhook:

https://api.telegram.org/botYOUR_BOT_TOKEN/setWebhook?url=YOUR_SERVER_URL/link_remover_bot.php

Note: Replace YOUR_BOT_TOKEN and YOUR_SERVER_URL with your actual bot token and server URL.


👨🏻‍💻 Posted by @BotVerseRavi



📢 Share this channel with your friends and remember to give credit if you use it on your channel!
32😁211
📢 How to Create Inline Search in TBC (Step-by-Step)


1️⃣ Enable Inline Mode in BotFather

Before your bot can respond to inline queries (like @YourBotName something), you must turn on inline mode:

1. Open @BotFather in Telegram.
2. Send /setinline.
3. Choose your bot.
4. Set a placeholder (e.g. Search something...).
5. Done — now Telegram will send inline queries to your bot.
2️⃣ Create the Command in Telebot Creator

• Go to your bot in TBC.
• Create a new command.
Name it exactly: /handler_inline_query
• This command will automatically run when someone types @YourBotName in any chat.

3️⃣ Full TPY Code with Static Data

# Posted by @BotVerseRavi on Telegram

# Get the text after the bot's username
query = message.query.strip() if message.query else ""

# If no query entered, show default items
if not query:
results = [
{
"type": "article",
"id": "1",
"title": "Static Result 1",
"description": "Example description",
"input_message_content": {
"message_text": "You selected Static Result 1"
}
},
{
"type": "article",
"id": "2",
"title": "Static Result 2",
"description": "Another example",
"input_message_content": {
"message_text": "You selected Static Result 2"
}
}
]
else:
# Show what the user typed
results = [
{
"type": "article",
"id": "typed",
"title": f"You searched: {query}",
"description": "Click to send this text",
"input_message_content": {
"message_text": f"You searched: {query}"
}
}
]

# Answer the inline query
bot.answerInlineQuery(
message.id,
results,
cache_time=1
)

4️⃣ How It Works
• If the user types @YourBotNameshows two static items.

• If the user types @YourBotName hello → shows their search text as a result.

• You can replace the static data with API results later (Pixabay, Google Images, etc.).

5️⃣ Testing
1. Open any chat (even Saved Messages).

2. Type: @YourBotName

→ See static results.
3. Type:
@YourBotName cats


→ See “You searched: cats”.

👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
2👍1🔥1🎉1🤩1🏆1
🤖 Telegram Story Download [TPY]


Command : *

# Posted by @BotVerseRavi on Telegram
username = msg.strip()
User.saveData("story_username", username)
res = HTTP.get(f"https://telegram-story.apis-bj-devs.workers.dev/?username={username}&action=archive")
data = res.json()

if data["status"] and data["result"]["totalStories"] > 0:
User.saveData("story_data", data["result"]["stories"])
Bot.runCommand("show_story")
else:
bot.sendMessage("No stories found or invalid username.")

Command : show_story

# Posted by @BotVerseRavi on Telegram
index = int(User.getData("story_index") or 0)
stories = User.getData("story_data")

if index < 0 or index >= len(stories):
bot.sendMessage("Invalid story index.")
else:
if message.message_id:
message_id = message.message_id
bot.deleteMessage(
chat_id=message.chat.id,
message_id=message_id
)
story = stories[index]
User.saveData("story_index", index)

keyboard = [[
{"text": " Back", "callback_data": "prev_story"},
{"text": "Next ", "callback_data": "next_story"}
]]
bot.sendVideo(story["url"], caption=f"Story {index + 1} of {len(stories)}\nDate: {story['date']}", reply_markup={"inline_keyboard": keyboard})

Command : prev_story

# Posted by @BotVerseRavi on Telegram
bot.answerCallbackQuery(call.id,"Back Done ...",show_alert=False)
index = int(User.getData("story_index") or 0)
User.saveData("story_index", max(0, index - 1))
Bot.runCommand("show_story")

Command : next_story

# Posted by @BotVerseRavi on Telegram
bot.answerCallbackQuery(call.id,"Next Done ...",show_alert=False)
index = int(User.getData("story_index") or 0)
stories = User.getData("story_data")
User.saveData("story_index", min(index + 1, len(stories) - 1))
Bot.runCommand("show_story")

⚡️ Demo Project : @Stories_Downbot


👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
1🔥1🤩1👌1
Age calculator by date of birth


Command: /calculate
Answer: Enter your date of birth.
Format: DD-MM-YYYY

Wait for answer: true


👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
2🔥1😁1🤩1🤝1
BJS

// Posted by @BotVerseRavi on Telegram

function calculateDetailedAge(dobInput) {
    const dateFormat = /^\d{2}-\d{2}-\d{4}$/;
    if (!dateFormat.test(dobInput)) {
        Bot.sendMessage("Please enter your date of birth in format: DD-MM-YYYY");
        return;
    }

    const [day, month, year] = dobInput.split('-');
    const dob = new Date(`${year}-${month}-${day}`);
    const today = new Date();

    let ageYears = today.getFullYear() - dob.getFullYear();
    let ageMonths = today.getMonth() - dob.getMonth();
    let ageDays = today.getDate() - dob.getDate();

    if (ageDays < 0) {
        ageMonths--;
        ageDays += new Date(today.getFullYear(), today.getMonth(), 0).getDate();
    }

    if (ageMonths < 0) {
        ageYears--;
        ageMonths += 12;
    }

    const totalDays = Math.floor((today - dob) / (1000 * 60 * 60 * 24));
    const totalHours = totalDays * 24;
    const totalMinutes = totalHours * 60;
    const totalSeconds = totalMinutes * 60;
    const totalWeeks = Math.floor(totalDays / 7);
    const weeksDays = totalDays % 7;

    const nextBirthday = new Date(today.getFullYear(), dob.getMonth(), dob.getDate());
    if (nextBirthday < today) nextBirthday.setFullYear(today.getFullYear() + 1);
    const daysUntilNextBirthday = Math.floor((nextBirthday - today) / (1000 * 60 * 60 * 24));

    const ageInDifferentTimeUnits = ageYears + " years " + ageMonths + " months " + ageDays + " days\n- " +
        (ageYears * 12 + ageMonths) + " months " + ageDays + " days\n- " + totalWeeks + " weeks " +
        weeksDays + " days\n- " + totalDays + " days\n- " + totalHours + " hours\n- " + totalMinutes +
        " minutes\n- " + totalSeconds + " seconds";

    Bot.sendMessage(
        "• Calculated Information:\n\n" +
        "- Age: " + ageYears + " years\n" +
        "- Age on: " + today.toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }) + "\n" +
        "- Born on: " + dob.toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }) + "\n\n" +
        "• Actual age in different time units:\n" +
        "- " + ageInDifferentTimeUnits + "\n\n" +
        "• Upcoming birthday: " + daysUntilNextBirthday + " days left\n- " +
        nextBirthday.toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })
    );
}

calculateDetailedAge(message);

👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
1🔥1🤩1
🫶🏻 Delete URL From Group (Only For Group) [Bots Business Code]
Delete Message If it's contain any URL.


Command: *

🔍 BJS:
// Posted by @BotVerseRavi on Telegram
if (chat.chat_type != "private") {
const admin_id = [8055384069, 7500269454] //admin telegram 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
}


👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
1🔥1👏1🤩1
Automatic Deletion of Group Join and Leave Notifications [BJS]


Command: *

🔍 BJS:
// Posted by @BotVerseRavi on Telegram
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})
}
}


👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
1🔥1🤩1🤝1
ytdownloader.txt
3.6 KB
🎵 YouTube MP3 Downloader [TPY Code]


🔧 Command: *

📂 Paste the code from the .txt file into your Wildcard Command section to activate.

Easily download MP3 audio from YouTube links using this tool.
🚀 Fast | 🎧 High-Quality | 🔒 Safe


👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
🔥21👍1👏1🤩1🤝1
Telegram Star Payment Accept & Refund [BJS]


Command: /purchase
// Posted by @BotVerseRavi on Telegram
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)

// Posted by @BotVerseRavi on Telegram
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": 1234567890,
// "is_bot": false,
// "first_name": "Unknown",
// "username": "none",
// "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": "1234567890_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
// Posted by @BotVerseRavi on Telegram
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’
})



👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
🔥32👌1
Media is too big
VIEW IN TELEGRAM
🚀 Build Your Own WhatsApp Chatbot & Earn!


Want to run a WhatsApp bot for marketing without paying monthly tools?

All you need is:
A domain
Web hosting
WhatsJets SaaS PHP Script

Set it up once → use it forever.

Script Link: Click here


👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
🔥3🤩21
Forwarded from BotVerse by Ravi
🆕 Introducing Our Instagram Reel Download API!
Powered by @BotVerseRavi


📥 Easily download Instagram Reels via a simple API call. Whether you're a developer building a bot, app, or automation tool — this free public API is for you.

🚀 API Endpoint:

https://instagram-api-botverseravi.gt.tc/api.php/?url=<INSTAGRAM_REEL_URL>

📌 Example:

https://instagram-api-botverseravi.gt.tc/api.php/?url=https://www.instagram.com/reel/DKuM_oLvhQm/?igsh=cTIybHNrdTFqdG5y

🔗 Docs & Live Preview:

https://instagram-api-botverseravi.gt.tc

👨‍💻 Developer: @Unknown_RK01
🌐 Channel: @BotVerseRavi
🛠️ Support: @BotVerseRaviSupport

📜 Terms of Use | Privacy Policy
🔥42
Hey everyone! 👋

You can now contact us anytime via @BotVerseRavi_bot for instant basic info and FAQs.

Is your Telegram account restricted from messaging non-contacts?

No worries! Using the bot solves that issue—no restrictions, no hassle.

What you’ll get when you use the bot:

⦁ A separate FAQs button with answers to commonly asked questions by our developers and subscribers, so you can get quick help instantly.
⦁ A Contact button to reach out to us directly and get a response within 24 hours—especially if your questions are about bot deployment, programming, and related topics.

Try the bot now for smooth, fast support! 🚀

🌐 Channel: @BotVerseRavi
🛠️ Support: @BotVerseRaviSupport
🆘 Support Bot: @BotVerseRavi_bot
1👍1🔥1🥰1🙏1👌1
How to transfer a Telegram bot to another TeleBot Creator account [TPY Script]


ℹ️ Command: /sendBot

# Posted by @BotVerseRavi on Telegram

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")



👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
2🔥2👍1👏1🤩1
TBC Advanced Ping 🏓 Tester (TPY)


Command: /ping

# Posted by @BotVerseRavi on Telegram
start_time = time.time()

ping_message = bot.replyText(
chat_id=message.chat.id,
text=" Pinging... "
)

latency_ms = round((time.time() - start_time) * 1000)

if latency_ms <= 200:
quality_text = "🟢 Excellent"
elif latency_ms <= 400:
quality_text = "🟡 Good"
elif latency_ms <= 700:
quality_text = "🟠 Fair"
else:
quality_text = "🔴 Poor"

final_text = (
f"Pong 🏓\n\n"
f" <b>Response Time</b>\n"
f"├ 📊 <b>Latency:</b> <code>{latency_ms} ms</code>\n"
f"└ 🎯 <b>Quality:</b> {quality_text}\n\n"
f"🤖 <b>Bot Status:</b> Online & Responsive"
)

bot.editMessage_text(
text=final_text,
chat_id=message.chat.id,
message_id=ping_message.message_id,
parse_mode="HTML"
)


👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
🔥32👍1🤗1
⚠️ Attention — Please Read Carefully!


Anyone who leaves this channel even once will be automatically banned by our auto-kicker bot. Rejoining after that won’t be possible.

So, please think twice before leaving. For any questions, contact the admin.

Thanks for understanding! 😊

Support Group: @BotVerseRaviSupport
Support Bot: @BotVerseRavi_bot
🤝21👍1🔥1😢1
📁 Multiple File Sharing Telegram Bot [TPY Code Script]


Part 1


❤️‍🔥 Command: /start 
🔍 TPY:
# Posted by @BotVerseRavi on Telegram

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/BotVerseRavi"}
]]
}
)
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
# Posted by @BotVerseRavi on Telegram

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
1🔥1🥰1🤩1🏆1
Part 2


# Posted by @BotVerseRavi on Telegram
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:
# Posted by @BotVerseRavi on Telegram
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}"}
]]
}
)


👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
1👍1🔥1🥰1🤗1
Having trouble deploying your bot with our code scripts?


Let us know in the comments below! We're happy to help troubleshoot any issues you're encountering. Any suggestions you have for this channel are also welcome.
1🔥1🎉1🤝1
Reels Downloader [TPY Script]


Command: *

# Posted by @BotVerseRavi on Telegram

bot.sendChatAction(chat_id=message.chat.id, action="upload_video")

# Command: * (Wildcard to handle Instagram URL)
instagram_url = message.text
api_url = f"https://instagram-api-botverseravi.gt.tc/api.php/?url={instagram_url}"

try:
response = HTTP.get(api_url, proxy=True)
response.raise_for_status()
data = bunchify(response.json())

if data.statusCode == 200 and data.url:
video_url = data.medias[0].url #Accessing to .url inside the response

bot.sendVideo(
chat_id=message.chat.id,
video=video_url,
caption=f"<b>{data.title}</b>", #Adding Caption Here" ,
parse_mode="HTML"
)


else:
bot.sendMessage(
chat_id=message.chat.id,
text=" Sorry, I couldn't download the video. Please make sure the link is correct and the video is publicly available."
)


except Exception:
bot.sendMessage(
chat_id=message.chat.id,
text=" An error occurred while processing the video. Please try again later."
)

bot.sendChatAction(chat_id=message.chat.id, action="typing")


API Info: Click here

👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
🔥21🤩1🤝1
🛡 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:
// Posted by @BotVerseRavi
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)


❗️ Only use in state of high requirement, else BB server may get load.


👨🏻‍💻 Posted by @BotVerseRavi


📢 Share this channel with your friends and remember to give credit if you use it on your channel!
1🔥1🥰1🤩1
🤖 Vehicle Information Extraction [TPY]


Note: Combine both parts in the command, otherwise it won't function.

Part 1


# Posted by @BotVerseRavi
try:
args = msg.split(" ", 1)

# Check correct usage
if len(args) != 2:
bot.sendMessage(
" <b>Invalid format!</b>

"
"Use the correct format:
"
"<code>/rc VEHICLE_NUMBER</code>

"
" Example:
"
"<code>/rc KL43G1669</code>",
parse_mode="HTML"
)
raise ReturnCommand()

rc_number = args[1].strip().upper()

# Validate basic RC format
if len(rc_number) < 6 or len(rc_number) > 12:
bot.sendMessage(
f"⚠️ <b>Invalid Vehicle Number:</b> <code>{rc_number}</code>
"
"Please provide a valid RC format like <b>KL43G1669</b>.",
parse_mode="HTML"
)
raise ReturnCommand()

bot.sendChatAction("typing")

# 🌐 API Call
api_url = f"https://vehicle-eight-vert.vercel.app/api?rc={rc_number}"
res = HTTP.get(api_url, timeout=20)
data = res.json()

# Check data validity
details = data.get("details")
if not details:
bot.sendMessage(
f" No records found for <b>{rc_number}</b>.
Please verify the RC number and try again.",
parse_mode="HTML"
)
raise ReturnCommand()


Part 2: https://t.me/BotVerseRavi/271
1👍1🔥1😁1🏆1🤝1