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
๐Ÿšจ Urgent: Stand Against Racism! ๐Ÿšจ


Namaste,

@PajeetLaborCamp was created to spread hate and target Indian people and our religions. We are NOT victimsโ€”weโ€™re a strong, united community that stands up for respect and dignity! ๐Ÿ‡ฎ๐Ÿ‡ณ

Hereโ€™s what you can do:

โฆ Manually report as many posts as possible from @PajeetLaborCamp.
โฆ Use @SearchReport bot: Submit โ†’ @PajeetLaborCamp.
โฆ Try every reporting method to help get this channel banned!

Forward this message to your channels and groups to spread the word.

Comment "Jai Hind" if youโ€™ve taken action! ๐Ÿ’ช 

Letโ€™s show them we wonโ€™t tolerate hateโ€”are you with me?
โค3๐Ÿ”ฅ3๐Ÿ‘1
Thanks to those who understand their duties towards this nation. ๐Ÿ‡ฎ๐Ÿ‡ณ

Jai Hind! ๐Ÿซก
โค5๐Ÿคฉ1
Once we reach 100 subscribers we'll start posting awesome codes again...

Thank you guys! ๐Ÿ™‚
โค3๐Ÿ”ฅ1๐Ÿ‘Œ1
๐Ÿ˜Ž CHANNEL AUTO REACTION [BJS]


โœ… Command: *

// Posted by @BotVerseRavi on Telegram

var request2 =JSON.parse(request)

if(request2.channel_post){
var msgid = request2.channel_post.message_id
var ch = request2.channel_post.sender_chat.id

var myEmoji = ["๐Ÿ‘", "๐Ÿ‘Ž", "โค", "๐Ÿ”ฅ", "๐Ÿฅฐ", "๐Ÿ‘", "๐Ÿ˜", "๐Ÿค”", "๐Ÿคฏ", "๐Ÿ˜ฑ", "๐Ÿคฌ", "๐Ÿ˜ข", "๐ŸŽ‰", "๐Ÿคฉ", "๐Ÿคฎ", "๐Ÿ’ฉ", "๐Ÿ™", "๐Ÿ‘Œ", "๐Ÿ•Š", "๐Ÿคก", "๐Ÿฅฑ", "๐Ÿฅด", "๐Ÿ˜", "๐Ÿณ", "โคโ€๐Ÿ”ฅ", "๐ŸŒš", "๐ŸŒญ", "๐Ÿ’ฏ", "๐Ÿคฃ", "โšก", "๐ŸŒ", "๐Ÿ†", "๐Ÿ’”", "๐Ÿคจ", "๐Ÿ˜", "๐Ÿ“", "๐Ÿพ", "๐Ÿ’‹", "๐Ÿ–•", "๐Ÿ˜ˆ", "๐Ÿ˜ด", "๐Ÿ˜ญ", "๐Ÿค“", "๐Ÿ‘ป", "๐Ÿ‘จโ€๐Ÿ’ป", "๐Ÿ‘€", "๐ŸŽƒ", "๐Ÿ™ˆ", "๐Ÿ˜‡", "๐Ÿ˜จ", "๐Ÿค", "โœ", "๐Ÿค—", "๐Ÿซก", "๐ŸŽ…", "๐ŸŽ„", "โ˜ƒ", "๐Ÿ’…", "๐Ÿคช", "๐Ÿ—ฟ", "๐Ÿ†’", "๐Ÿ’˜", "๐Ÿ™‰", "๐Ÿฆ„", "๐Ÿ˜˜", "๐Ÿ’Š", "๐Ÿ™Š", "๐Ÿ˜Ž", "๐Ÿ‘พ", "๐Ÿคทโ€โ™‚", "๐Ÿคท", "๐Ÿคทโ€โ™€", "๐Ÿ˜ก"]

var doEmoji = myEmoji[Math.floor(Math.random() * myEmoji.length)];

HTTP.post({
url: "https://api.telegram.org/bot" + bot.token + "/setMessageReaction",
body: {
chat_id: ch,
message_id: msgid,
reaction: JSON.stringify([
{
type: "emoji",
emoji: doEmoji,
is_big: 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
Gแด‡แด› Rแด€ษดแด…แดแด Wษชษดษดแด‡ส€ ๐Ÿ† Iษด Yแดแดœส€ Cสœแด€ษดษดแด‡สŸ Wสœแด Pแด€ส€แด›ษชแด„ษชแด˜แด€แด›แด‡แด… Iษด Gษชแด แด‡แด€แดกแด€ส ๐Ÿ”ฅ
-----------------Cแดแด…แด‡s--------------------

[TBC]


Command : /start

#Posted by @BotVerseRavi pm Telegram.

broadcast = Bot.getData("broadcast")
if broadcast == None:
push = []
else:
push = broadcast

check_user = push.count(u)
if check_user > 0:
try:
bot.answerCallbackQuery(call.id,"You have already participated!",show_alert=True)
except:
bot.sendMessage("You have already participated!")
raise ReturnCommand
else:
push.append(u)
Bot.saveData("broadcast", push)
try:
bot.answerCallbackQuery(call.id,"You have participated successfully!",show_alert=True)
except:
bot.replyText(u, "You have participated successfully!")

markup = InlineKeyboardMarkup()
markup.add(InlineKeyboardButton(text="Participate",callback_data="/start"))
Broadcast = Bot.getData("broadcast")
Promo = "Join ๐Ÿ‘‰ <a href='https://t.me/BotVerseRavi'>BotVerse by Ravi</a>"
Prize = "2 TRX"
Winners = "1"
Already = Bot.getData("Already")
if Already == None:
msg = bot.sendMessage(chat_id="@channel_isd",text=f"""๐ŸŽ‰ GIVEAWAY ๐ŸŽ‰ ๐Ÿ‘ฅ{len(Broadcast)}

โ€ข Prize: {Prize}
โ€ข Winners: {Winners}
โ€ข Ending: 2 Days

{Promo}""",disable_web_page_preview=True,reply_markup=markup)
Bot.runCommandAfter(timeout=86400,command="completed", options=msg.message_id)
Bot.saveData("Already",True)
else:
bot.editMessageText(chat_id="@channel_ids",message_id=message.message_id,text=f"""๐ŸŽ‰ GIVEAWAY ๐ŸŽ‰ ๐Ÿ‘ฅ{len(Broadcast)}

โ€ข Prize: {Prize}
โ€ข Winners: {Winners}
โ€ข Ending: 2 Days

{Promo}""",disable_web_page_preview=True,reply_markup=markup)

Command : completed

# Posted by @BotVerseRavi on Telegram.

Bot.runCommandAfter(timeout=86400,command="completed2", options=options)

Command: completed2

# Posted by @BotVerseRavi on Telegram.

broadcast = Bot.getData("broadcast")
random = libs.Random.randomInt(0, len(broadcast)-1)
winner = broadcast[random]
chat = bot.getChat(winner)
bot.editMessageText(chat_id="@channel_idS", message_id=options,text=f"๐Ÿ† <b>Winner Found\n\n๐Ÿ‘ค User: {chat.first_name}\n๐Ÿ†” Telegram ID: {winner}</b>")

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป 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
๐Ÿ”ฅ New Device Verification Is Live ๐Ÿ‘‡ [TBC]


๐Ÿ”ฐ Command
/verify

Part 1


# Posted by @BotVerseRavi on Telegram.

uppercase_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lowercase_letters = "abcdefghijklmnopqrstuvwxyz"
numbers = "0123456789"
# Combine the pools
all_characters = uppercase_letters + lowercase_letters + numbers


# Generate a 34-character random hash
random_hash = "".join(libs.random.randomWeightedChoice(all_characters, [1] * len(all_characters)) for _ in range(34))

webhook = libs.Webhook.getUrlFor(command="/onWebhook", user_id=u)

try:
response = HTTP.get(f"https://bot.tamimwebdev.xyz/system-finder-dev/webhook_api.php?botHash={random_hash}&bot={Bot.info().username}&webhook_url={webhook}")
response_data = response.json() # Parse JSON response

# Format response message

except Exception as e:
bot.sendMessage(e)
pass

webPage = f"https://bot.tamimwebdev.xyz/system-finder-dev/work-vercel-html.php?botHash={random_hash}&bot={Bot.info().username}"
keys = [[InlineKeyboardButton(text='Verify', web_app=webPage)]]
button = InlineKeyboardMarkup(keys)

bot.sendMessage("<b>๐Ÿ” Verify Yourself To Start Bot</b>", reply_markup=button)

๐Ÿ”ฐCommand /onWebhook

Important: to get menu and don't want to give referral bonus then use this code to continue menu


# Posted by @BotVerseRavi on Telegram 

if options is None or options.json is None:
bot.replyText(u, "โŒ Not Allowed", parse_mode="Markdown")
raise ReturnCommand()
else:
data = bunchify(options.json)
bot.sendMessage(data)

# Extract values from IP worker response
status = data.get("status")
user_id = str(data.get("user_id"))
message_text = data.get("message", "")

# Default values
verified_key = str(u) + "verify"

# If already verified
if Bot.getData(verified_key):
raise ReturnCommand()

# Save success
if status == "success":
User.saveData("AllOk", "True")
Bot.saveData(verified_key, "verified")

keyboard = ReplyKeyboardMarkup(True)
keyboard.row("๐ŸŽ‰ Balance", "๐Ÿ‘ซ Refer & Earn")
keyboard.row("๐ŸŽ Bonus")
keyboard.row("๐Ÿ” Link UPI", "๐Ÿš€ Withdraw")

bot.replyText(
chat_id=message.chat.id,
text="<b>๐Ÿ’ซ Welcome To Cash Giveaway Bot!</b>",
reply_markup=keyboard
)
raise ReturnCommand()

# Duplicate or multi-device detected, still allow access
elif status == "fail":
User.saveData("AllOk", "True")
Bot.saveData(verified_key, "verified")

keyboard = ReplyKeyboardMarkup(True)
keyboard.row("๐ŸŽ‰ Balance", "๐Ÿ‘ซ Refer & Earn")
keyboard.row("๐ŸŽ Bonus")
keyboard.row("๐Ÿ” Link UPI", "๐Ÿš€ Withdraw")

bot.replyText(
chat_id=message.chat.id,
text=f"<b>๐Ÿก Welcome To Refer & Earn Bot!\n\n๐Ÿ‘€ Same Device Detected By System!\n\nStill You Can Refer & Earn ๐Ÿฅณ</b>",
reply_markup=keyboard
)
raise ReturnCommand()

# Already verified (continue)
elif status == "continue":
Bot.saveData(verified_key, "verified")
User.saveData("AllOk", "True")

keyboard = ReplyKeyboardMarkup(True)
keyboard.row("๐ŸŽ‰ Balance", "๐Ÿ‘ซ Refer & Earn")
keyboard.row("๐ŸŽ Bonus")
keyboard.row("๐Ÿ” Link UPI", "๐Ÿš€ Withdraw")

bot.replyText(
chat_id=message.chat.id,
text="<b>๐Ÿ’ซ Welcome To Cash Giveaway Bot!</b>",
reply_markup=keyboard
)
raise ReturnCommand()

# If none matched
else:
bot.replyText(u, "โŒ Not Allowed", parse_mode="Markdown")
raise ReturnCommand()

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป 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
Need this Bot TPY Code?
๐Ÿ‘1๐ŸŽ‰1๐Ÿค—1
๐Ÿ“ข Update: Privacy Policy & Terms of Use


We've updated our Privacy Policy and Terms of Use to improve clarity and reflect how we handle your data and services.

To continue using our bots & mini-apps, please take a moment to review the new policies.

๐Ÿ”— Privacy Policy
๐Ÿ”— Terms of Use

By continuing, you agree to the updated terms. If you have questions, feel free to contact @BotVerseRaviSupport.

Thank you for your trust and support! โค๏ธ
โค3๐Ÿ™2
Part 2 [TBC]


๐Ÿ”ฐCommand /onWebhook

Important for ban users directly

# Posted by @BotVerseRavi on Telegram
# Check if 'json' key exists

if options is None or options.json is None:
bot.replyText(u, "โŒ Not Allowed", parse_mode="Markdown")
raise ReturnCommand()

# Extract fields from IP worker JSON response
response = options['json']
status = response.get('status')
user_id = response.get('user_id')
message_text = response.get('message', "")

# Ban check based on status
if status == "continue":
bot.sendMessage(
"โœ”๏ธ <b>Youโ€™re already a verified user!</b>\n\n"
"๐Ÿ”„ Redirecting you to the main menu...",
parse_mode="html"
)
# Bot.runCommand('/main-menu')
raise ReturnCommand()

elif status == "fail":
User.saveData('ban_u', True)
if "duplicate" in message_text.lower():
bot.sendMessage(
"๐Ÿšจ <b>Security Violation Detected!</b>\n\n"
"โš ๏ธ Multiple accounts detected from your device.\n"
"Youโ€™ve been <u>banned</u> from using this bot.",
parse_mode="html"
)
else:
bot.sendMessage(
"๐Ÿšซ <b>Access Denied!</b>\n\n"
"Weโ€™ve detected <u>suspicious activity</u> or proxy use.\n"
"You have been <b>permanently banned</b> from using this bot.",
parse_mode="html"
)
raise ReturnCommand()

elif status == "success":
User.saveData("verification_made", True)
bot.sendMessage(
"โœ… <b>Verification Successful!</b>\n\n"
"๐ŸŽ‰ You're now verified and can use all features of the bot.",
parse_mode="html"
)
raise ReturnCommand()

else:
bot.sendMessage(
"โ“ <b>Unknown response received.</b>\n\n"
"Please try again or contact support.",
parse_mode="html"
)
raise ReturnCommand()

๐Ÿ”ฐ Command @

# Posted by @BotVerseRavi on Telegram

if User.getData('ban_u') == True:
bot.sendMessage(
"๐Ÿšซ <b>Access Denied!</b>\n\n"
"Weโ€™ve detected <u>suspicious activity</u> or proxy use.\n"
"You have been <b>permanently banned</b> from using this bot.",
parse_mode="html"
)
raise returnCommand()

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป Posted by @BotVerseRavi


๐Ÿ“ข Share this channel with your friends and remember to give credit if you use it on your channel!
โค6๐Ÿ‘1
Device Verification Script [TBC]


1โƒฃ Part 1
2โƒฃ Part 2

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป 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
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