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! π
Happy Coding! π
β€3π2π₯1π₯°1π1π1
π± GitHub Profile Information [TBC]
Command :
/githubExample :
/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!
π2 2β€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π1 1
π 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π€©1 1
β€οΈβπ₯ All Necessary Info:
π’ Share this channel with your friends and remember to give credit if you use it on your channel!
β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 likehttps://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π€1 1
π Introducing Our Instagram Reel Download API!
π₯ 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.
https://instagram-api-botverseravi.gt.tc
π¨βπ» Developer: @Unknown_RK01
π Channel: @BotVerseRavi
π οΈ Support: @BotVerseRaviSupport
π Terms of Use | Privacy Policy
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π1 1
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π€1 1 1
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!
π’ 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οΈβ£ Create the Command in Telebot Creator
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.
β’ 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:
/calculateAnswer:
Enter your date of birth.
Format: DD-MM-YYYYWait 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
π’ Share this channel with your friends and remember to give credit if you use it on your channel!
// 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]
β€ Command:
π BJS:
βββββββββββββββββ
π’ Share this channel with your friends and remember to give credit if you use it on your channel!
β 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!
π₯2β€1π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!
π₯3β€2π1