BotVerse by Ravi
158 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
BotVerse by Ravi
Need this Bot TPY Code?
Do you all want this?
Final Results
80%
Yes
20%
No
0%
I don't know
πŸ‘2
✏️ Text Quiz Poll Maker πŸ‘₯ [TPY]


πŸ”˜ Command: /quiz

# Posted by @BotVerseRavi on Telegram 

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

parts = message.text.split(" ", 1)
if len(parts) > 1:
topic = parts[1]
else:
topic = "quiz"

api_url = f"https://pollmakerai.apinepdev.workers.dev/?question={topic}"

try:
response = HTTP.get(api_url)
response.raise_for_status()
data = response.json()

question = data.get("question")
options = data.get("options", [])
correct_answer = data.get("correct_answer")
explanation = data.get("explanation")

if not all([question, options, correct_answer]):
bot.sendMessage(
chat_id=message.chat.id,
text=f"❌ Sorry, I couldn't find a quiz for the topic '{topic}'. Please try another one."
)
raise ReturnCommand()

correct_option_id = options.index(correct_answer)

bot.sendPoll(
chat_id=message.chat.id,
question=question,
options=options,
type='quiz',
correct_option_id=correct_option_id,
explanation=explanation,
is_anonymous=False
)

except Exception as e:
bot.sendMessage(
chat_id=message.chat.id,
text="❌ An error occurred while fetching the quiz. Please try again later."
)


πŸ› οΈ How to Use:

Use the command /quiz or type quiz followed by your topic. For example, quiz History of the Roman Empire..


πŸ‘¨πŸ»β€πŸ’» 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.
πŸ”₯2❀1πŸ‘1
BotVerse by Ravi
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.
No issues, great!  Everyone is successfully deploying their bots using our script.

Happy Coding! 😊
❀3πŸ‘2πŸ”₯1πŸ₯°1πŸ‘1😁1
πŸ“± GitHub Profile Information [TBC]


Command : /github

Example : /github BotVerseRavi

# Posted by @BotVerseRavi on Telegram

if not params:
bot.sendMessage("❌ Please provide a GitHub username.\n\nExample:\n<code>/github BotVerseRavi</code>", parse_mode="HTML")
raise ReturnCommand()

username = params.strip()
url = f"https://api.github.com/users/{username}"

try:
res = HTTP.get(url)
data = res.json()

if "message" in data and data["message"] == "Not Found":
bot.sendMessage(f"❌ GitHub user <b>{username}</b> not found.", parse_mode="HTML")
raise ReturnCommand()

# Extract all fields
name = data.get("name") or "N/A"
login = data.get("login") or "N/A"
id_ = data.get("id") or "N/A"
node_id = data.get("node_id") or "N/A"
avatar = data.get("avatar_url") or ""
html_url = data.get("html_url") or ""
repos_url = data.get("repos_url") or ""
followers_url = data.get("followers_url") or ""
following_url = data.get("following_url") or ""
gists_url = data.get("gists_url") or ""
blog = data.get("blog") or "N/A"
location = data.get("location") or "N/A"
email = data.get("email") or "N/A"
hireable = str(data.get("hireable")) or "N/A"
bio = data.get("bio") or "No bio provided."
twitter = data.get("twitter_username") or "N/A"
company = data.get("company") or "N/A"
followers = data.get("followers", 0)
following = data.get("following", 0)
public_repos = data.get("public_repos", 0)
public_gists = data.get("public_gists", 0)
created = data.get("created_at") or "N/A"
updated = data.get("updated_at") or "N/A"

# Format message
text = (
f"<b>πŸ‘€ GitHub Profile</b>\n"
f"πŸ‘¨β€πŸ’» Name: <b>{name}</b>\n"
f"πŸ”‘ Username: <code>{login}</code>\n"
f"πŸ†” ID: <code>{id_}</code>\n"
f"🧬 Node ID: <code>{node_id}</code>\n"
f"πŸ“ Location: {location}\n"
f"🏒 Company: {company}\n"
f"πŸ“° Blog: {blog}\n"
f"βœ‰οΈ Email: {email}\n"
f"πŸ“Œ Hireable: {hireable}\n"
f"🐦 Twitter: {twitter}\n"
f"πŸ“¦ Public Repos: <b>{public_repos}</b>\n"
f"πŸ—ƒοΈ Gists: <b>{public_gists}</b>\n"
f"πŸ‘₯ Followers: <b>{followers}</b> | Following: <b>{following}</b>\n"
f"πŸ“ Bio: <i>{bio}</i>\n"
f"πŸ“… Created: {created}\n"
f"πŸ› οΈ Updated: {updated}\n"
f"πŸ”— Profile: <a href='{html_url}'>{html_url}</a>\n"
f"πŸ“ Repos: <a href='{repos_url}'>Repos Link</a>\n"
f"πŸ‘€ Followers: <a href='{followers_url}'>Followers</a>\n"
f"➑️ Following: <a href='{following_url}'>Following</a>\n"
f"πŸ“‘ Gists: <a href='{gists_url}'>Gists</a>"
)

bot.sendPhoto(photo=avatar, caption=text, parse_mode="HTML")

except Exception as e:
bot.sendMessage("⚠️ Failed to fetch GitHub profile. Try again later.")


πŸ‘¨πŸ»β€πŸ’» 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
πŸ€– Random Card πŸ’³ Generator [TBC]


Command : /gen

# Posted by @BotVerseRavi on Telegram

try:
# Helper function to generate a random number string
def generate_digits(length):
return ''.join([str(libs.Random.randomInt(0, 9)) for _ in range(length)])

# Generate card details
card_number = generate_digits(16)
cvv = generate_digits(3)
month = str(libs.Random.randomInt(1, 12)).zfill(2)
year = libs.Random.randomInt(2025, 2030)
expiry = f"{month}/{year}"

# Enhanced UI Output
card_info = f"""
<b>πŸ’³ Virtual Card Generator</b>
━━━━━━━━━━━━━━━━━━
<b>πŸ”’ Card Number:</b>
<code>{card_number}</code>

<b>πŸ“… Expiry Date:</b>
<code>{expiry}</code>

<b>πŸ” CVV:</b>
<code>{cvv}</code>
━━━━━━━━━━━━━━━━━━
<b>βœ… Generated Successfully!</b>
"""

# Send the formatted message
bot.sendMessage(card_info.strip(), parse_mode="html")

except Exception as e:
bot.sendMessage(f"⚠️ <b>Error:</b> <code>{str(e)}</code>", 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❀1πŸ‘1🀩1πŸ™1
πŸ€– ❓How To Set Bot Menu Commands In Your Bot [TBC]


🧩 Command: /setMyCommands

# Posted by @BotVerseRavi on Telegram

bot_token = Bot.info().token

commands = [
{'command': 'start', 'description': 'start me'},
{'command': 'help', 'description': 'get help'},
{'command': 'list', 'description': 'just ok'}
]

# Set the commands
url = f'https://api.telegram.org/bot{bot_token}/setMyCommands'
headers = {'Content-type': 'application/json'}
data = {
'commands': commands,
'scope': {'type': 'default'}
}
response = bunchify(HTTP.post(url, headers=headers, json=data).json())
bot.replyText(u, response)

πŸ‘¨πŸ»β€πŸ’» 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
πŸ€– Broadcast [TPY Script]


Command : /broadcast

# Posted by @BotVerseRavi on Telegram

admins = ["123456789"]
if str(u) not in admins:
raise ReturnCommand()

if options == None:
bot.replyText(u, "<b>πŸŽ™οΈ Send Any Message To Broadcast in HTML\n\nTo Cancel: /cancel</b>", parse_mode="html")
Bot.handleNextCommand("/broadcast", options=True)
raise ReturnCommand()
else:
if message.text == "/cancel":
bot.sendMessage("<b>❌ Cancelled</b>", parse_mode="html")
raise ReturnCommand()

# Function to create broadcast code
def broadcast(method, txt, fileId):
typ = method.lower()
if method == "Message":
code = f"""bot.sendMessage(chat_id=u, text='''{txt}''', parse_mode="html")"""
elif str(txt) == "None":
code = f"""bot.send{method}(chat_id=u, {typ}="{fileId}")"""
else:
code = f"""bot.send{method}(chat_id=u, {typ}="{fileId}", caption='''{txt}''', parse_mode="html")"""
return code

# Detect content and apply HTML formatting
txt = message.caption if message.caption else message.text
entities = message.caption_entities if message.caption else message.entities
txt = apply_html_entities(txt, entities, {}) # Corrected with third param

# Identify message type and prepare broadcast
if message.photo:
code = broadcast("Photo", txt, message.photo[-1].file_id)
elif message.text:
code = broadcast("Message", txt, None)
elif message.video:
code = broadcast("Video", txt, message.video.file_id)
elif message.audio:
code = broadcast("Audio", txt, message.audio.file_id)
elif message.document:
code = broadcast("Document", txt, message.document.file_id)
elif message.sticker:
code = broadcast("Sticker", txt, message.sticker.file_id)
elif message.animation:
code = broadcast("Animation", txt, message.animation.file_id)
else:
bot.sendMessage("<b>❌ Wrong File Format!</b>", parse_mode="html")
raise ReturnCommand()

# Launch the broadcast
url = libs.Webhook.getUrlFor("/broadResult", u)
task = Bot.broadcast(code=code, callback_url=url)
Bot.saveData(task, None)
bot.sendMessage("<b>πŸ” Broadcast Processing...</b>", parse_mode="html")

Command : /broadResult

# Posted by @BotVerseRavi on Telegram

try:
get = options.json
total = get.total
success = get.total_success
fail = get.total_errors

txt = f"""<b>
πŸŽ™οΈ Broadcast Done

πŸ‘₯ Total: {total}
βœ… Success: {success}
❌ Failed: {fail}
</b>"""
bot.sendMessage(txt)
except:
bot.sendMessage("<b>❌ Broadcast Data Process Failed</b>")

⚠️ Note: Replace 123456789 with your user 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
πŸ“Œ YouTube Video Summarizer Code (BJS for Bots.Business)


πŸ“œ Description: Summarize YouTube videos up to 1000 words. 
πŸš€ Command: /start 
⏳ Wait for response: βœ… On

---

πŸš€ Command: /start

// Posted by @BotVerseRavi on Telegram

Bot.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

// Posted by @BotVerseRavi on Telegram

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)

// Posted by @BotVerseRavi on Telegram

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

// Posted by @BotVerseRavi on Telegram

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: /onSummaryError

// Posted by @BotVerseRavi on Telegram

Bot.sendMessage("🚫 Failed to connect to the summarization API. Please try again later.");


πŸ‘¨πŸ»β€πŸ’» Posted by @BotVerseRavi

 
πŸ“’
Share this with your friends and remember to give credit if you use it on your channel!
πŸ‘22❀1πŸ”₯1🀩1
πŸ€– Random Quote Sender [TPY]


Command : /quote

# Posted by @BotVerseRavi on Telegram

api_url = "https://zenquotes.io/api/random"
response = HTTP.get(api_url)
   
if response.status_code == 200:
    data = response.json()
    quote = data[0]["q"]
    author = data[0]["a"]
       
    message_text = f"❝ {quote} ❞\n\nβ€” *{author}*"
    bot.sendMessage(chat_id=u, text=message_text, parse_mode="Markdown")
else:
    bot.sendMessage("Failed to fetch a quote. Please try again later.")

πŸ‘¨πŸ»β€πŸ’» Posted by @BotVerseRavi


πŸ“’ Share this channel with your friends and remember to give credit if you use it on your channel!
❀1πŸ”₯1🀩1πŸ™11
🌟 Free Image Processing API Source Code


// Posted by @BotVerseRavi on Telegram

export default {
async fetch(request) {
const url = new URL(request.url);
const imageUrl = url.searchParams.get("url");
const tool = url.searchParams.get("tool");

if (!imageUrl || !tool) {
return new Response("Missing required parameters: url and tool", { status: 400 });
}

const apiEndpoints = {
removebg: "https://api.remove.bg/v1.0/removebg",
enhance: "https://api.deepai.org/api/torch-srgan",
upscale: "https://api.deepai.org/api/waifu2x",
restore: "https://api.deepai.org/api/image-editor",
colorize: "https://api.deepai.org/api/colorizer"
};

const apiKey = {
removebg: "YOUR_REMOVEBG_API_KEY",
deepai: "YOUR_DEEPAI_API_KEY"
};

if (!apiEndpoints[tool]) {
return new Response("Invalid tool specified", { status: 400 });
}

try {
let apiUrl = apiEndpoints[tool];
let headers = {};
let body = {};

if (tool === "removebg") {
headers["X-Api-Key"] = apiKey.removebg;
body = new URLSearchParams({ image_url: imageUrl });
} else {
headers["api-key"] = apiKey.deepai;
body = new URLSearchParams({ image: imageUrl });
}

const apiResponse = await fetch(apiUrl, {
method: "POST",
headers: headers,
body: body
});

if (!apiResponse.ok) {
throw new Error("Failed to process image");
}

const jsonResponse = await apiResponse.json();
const resultUrl = jsonResponse.output_url || jsonResponse.data?.output_url;

if (!resultUrl) {
throw new Error("No output received");
}

const finalImageResponse = await fetch(resultUrl);
return new Response(finalImageResponse.body, {
headers: { "Content-Type": finalImageResponse.headers.get("Content-Type") }
});

} catch (error) {
return new Response(`Error processing request: ${error.message}`, { status: 500 });
}
}
};


⛓️ API Format:
https://your-worker-subdomain.worker.dev/?url=<IMAGE_URL>&tool=<TOOL_NAME>

πŸ“š Example API Request:
https://your-worker-subdomain.worker.dev/?url=https://example.com/image.jpg&tool=removebg


πŸ‘¨πŸ»β€πŸ’» Posted by @BotVerseRavi


πŸ“’ Share this channel with your friends and remember to give credit if you use it on your channel!
❀4πŸ”₯2😁1🀩11
❀️‍πŸ”₯ All Necessary Info:

β–ŽHow to Host on Workers.dev Get API Keys

β–ŽHosting on Cloudflare Workers (workers.dev)

1️⃣ Sign Up for Cloudflare 
Go to https://workers.cloudflare.com/ and sign up if you don’t have an account. 
Once signed in, navigate to the Workers  Pages section.

2️⃣ Create a New Worker 
Click on "Create Application" β†’ Select "Worker". 
In the Worker editor, replace the default code with your script.

3️⃣ Deploy Your Worker 
Click "Save and Deploy" to make it live. 
You’ll receive a unique URL like https://your-worker-subdomain.worker.dev/ that you can use for API requests.

4️⃣ Custom Domain (Optional) 
You can map your Worker to a custom domain via Cloudflare’s DNS Settings.

---

β–ŽHow to Get API Keys for Image Processing

βœ… Remove.bg API Key 
Sign up at https://www.remove.bg/api and generate an API key from your account.

βœ… DeepAI API Key (For Upscale, Enhance, Restore, Colorize) 
Sign up at https://deepai.org/ and navigate to the API section to get your key.

πŸ’‘ Where to Add the Keys? 
Replace "YOURREMOVEBGAPIKEY" and "YOURDEEPAIAPIKEY" in the script with your actual keys.

---

β–ŽAvailable Modes (tool parameter values)

1️⃣ removebg – Removes background from images using Remove.bg API. 
2️⃣ enhance – Enhances image quality using DeepAI’s torch-srgan. 
3️⃣ upscale – Upscales images using DeepAI’s waifu2x. 
4️⃣ restore – Restores images using DeepAI’s image-editor. 
5️⃣ colorize – Converts black  white images to color using DeepAI’s colorizer.

πŸ’‘ Example Usage: 
https://your-worker-subdomain.worker.dev/?url=https://example.com/image.jpg&tool=upscale



πŸ‘¨πŸ»β€πŸ’» Posted by @BotVerseRavi


πŸ“’ Share this channel with your friends and remember to give credit if you use it on your channel!
πŸ”₯3❀1πŸ₯°1🀝11
πŸ†• 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
❀2πŸ”₯1🀩1πŸ‘Œ1πŸ†11
Type this command to get complete bot statistics πŸ“Š β€” including Bot ID, username, name, and more! [TPY]
Command : /your_command_name

# Posted by @BotVerseRavi on Telegram

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 BotVerse by Ravi\nJoin : @BotVerseRavi"

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


πŸ‘¨πŸ»β€πŸ’» Posted by @BotVerseRavi


πŸ“’ Share this channel with your friends and remember to give credit if you use it on your channel!
πŸ”₯1πŸ™1🀝111
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!
3❀2😁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 @YourBotName β†’ shows 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