๐ซถ๐ป Delete URL From Group (Only For Group) [Bots Business Code]
โค Command:
๐ BJS:
โโโโโโโโโโโโโโโโโ
โ ๏ธ Give credit if you are posting on your channel.
๐จโ๐ป Created By: Swastik
ยฉ Credit: @botnations.
โ Delete Message If it's contain any URL.
โค Command:
* ๐ BJS:
if (chat.chat_type != "private") {
const admin_id = [1789993737, 6261873071]//admin tg id here
if (!admin_id.includes(user.telegramid)) {
function validURL(url) {
var regex = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/
return regex.test(url)
}
if (validURL(message)) {
var message_id = request.message_id
Api.deleteMessage({
message_id: message_id
})
return
}
return
}
return
}โโโโโโโโโโโโโโโโโ
โ ๏ธ Give credit if you are posting on your channel.
๐จโ๐ป Created By: Swastik
ยฉ Credit: @botnations.
โค14๐ณ3
๐จโ๐ปGroup Join & Left Messages auto delete BJS :
โค Command:
๐ BJS:
โโโโโโโโโโโโโโโโโ
โ ๏ธ Give credit if you are posting on your channel.
๐จโ๐ป Created By: Swastik
ยฉ Credit: @botnations.
โค Command:
* ๐ BJS:
if(chat.chat_type!="private"){
let new_members = request.new_chat_members;
if(new_members.length > 0){
Api.deleteMessage({chat_id:request.chat_id, message_id: request.message_id})
}
let left_members = request.left_chat_member;
if(left_members != null){
Api.deleteMessage({chat_id:request.chat_id, message_id: request.message_id})
}
}โโโโโโโโโโโโโโโโโ
โ ๏ธ Give credit if you are posting on your channel.
๐จโ๐ป Created By: Swastik
ยฉ Credit: @botnations.
โค11๐ฅ2
Forwarded from Coding with Mohit
Just because of some Copy Paste Bot Makers the real ones are facing this type of non-sense ๐
Literally they didn't even know what an actual price of a bot is.....
Even I ask around 20-30% low price of the Orginal ones but still they think that no..! It's scam!
But who goes to them & say โ Sir, just try making one yourself then you would realise the time + efforts + stress + knowledge it takes.... ๐
The Copy Makers are just like a Hazardous Chemical which is eating the Real Community of Bot Developers.
Kitna bhi bol lo kam hai inlogon ke kiye, Customers/Clients ki koi galti nahi hai sab in so called Copy Bot Makers ke wajah se.
Note: I'm not saying anything to Clients/Customers ๐
Literally they didn't even know what an actual price of a bot is.....
Even I ask around 20-30% low price of the Orginal ones but still they think that no..! It's scam!
But who goes to them & say โ Sir, just try making one yourself then you would realise the time + efforts + stress + knowledge it takes.... ๐
The Copy Makers are just like a Hazardous Chemical which is eating the Real Community of Bot Developers.
Kitna bhi bol lo kam hai inlogon ke kiye, Customers/Clients ki koi galti nahi hai sab in so called Copy Bot Makers ke wajah se.
Note: I'm not saying anything to Clients/Customers ๐
โค16๐ฅฐ5๐4๐ฅ1
โญ Telegram Star Payment Accept & Refund BJS
(Master Command)
๐งโ๐ป Coded by @devendra
ยฉ Copyright: BjsCodes
Command:
/purchase
Api.sendInvoice({
chat_id: user.telegramid, //chat id to send invoice at
title: "Product",
//add a product name
description: "This is a Digital Product",
//add a description of your product here
payload: "payload",
//add a payload, which you want after successful of payment. for example order id...
currency: "XTR", //for telegram stars
provider_token: "", //empty string for telegram stars
//protect_content: true,
//uncomment if you don't want forwarding post
start_parameter: "star",
//if the invoice messgae is forwarded, in place of Pay button it will show a deep link to your bot with this parameter
prices: [
{
label: "test", //add a label
amount: 1 //Amount of Telegram Stars
}
],
reply_markup: {
inline_keyboard: [[{ text: "Buy for โญ๏ธ 1", pay: true }]]
//the first star emoji in text of pay button of keyboard will be converted to Telegram star icon
}
})Command:
*
(Master Command)
let update = request
try { update = JSON.parse(request) } catch (e) {}
if (update.pre_checkout_query) {
//check for pre checkout query update and answer it to let the user complete payment
Api.answerPreCheckoutQuery({
pre_checkout_query_id: update.pre_checkout_query.id,
ok: true //false if need to cancel payment when uses confirms to pay
//error: 'error message in human readable form'
//^ required if ok is set to false
})
//Here is inspected update.pre_checkout_query for other details:
//{
// "id": "32802642947578352877",
// "from": {
// "id": 5058713343,
// "is_bot": false,
// "first_name": "Mr Devendra ๐ฎ๐ณ",
// "username": "devendra",
// "language_code": "en",
// "is_premium": true
// },
// "currency": "XTR",
// "total_amount": 1,
// "invoice_payload": "payload like order id"
//}
//Note: here update is received with pre_checkout_query field
} else if (update.successful_payment) {
//check for a received payment and respond accordingly
Bot.sendMessage(
`Payment of โญ๏ธ${update.successful_payment.total_amount} is successful`
)
//Here is inspected update.successful_payment for other details:
//{
// "currency": "XTR",
// "total_amount": 1,
// "invoice_payload": "payload like order id",
// "shipping_option_id": null,
// "order_info": null,
// "telegram_payment_charge_id": "charge id",
// "provider_payment_charge_id": "5058713343_12"
//}
//Note: here update is received with message field, so you can can user,chat details with request.from/request.chat etc...
//refer to message field at https://core.telegram.org/bots/api#message
}
Command:
/refund
var chargeId = 'charge ID'//telegram payment charge id, to send a refund
//this is provide through successful_payment parameter of message update
var userId = โuser telegram idโ //telegram id of user who made the star payment
API.call(โrefundStarPaymentโ,{
user_id: userId,
telegram_payment_charge_id: chargeId
})
API.sendMessage({
user_id: userId,
text:โWe are refunding your Star Paymentโ
})
๐งโ๐ป Coded by @devendra
ยฉ Copyright: BjsCodes
โค20๐คฉ1
Forwarded from Rare Codes (Rajkumar)
๐จ Ephoto360 Image Generator API ๐จ
โจ Create your own stylish text images in just one API call!
๐ API Endpoint:
๐ Required Fields:
โ ๐ apiKey โ Get From PRxStoneBot
โ ๐ญ theme โ get From Ephoto360
โ ๐ text โ First text (required)
โ ๐ text1 โ Second text (optional, for two-line text)
๐ท Result:
๐ฅ Try it now and turn your text into art!
Bots.business Code - Click Here
โจ Create your own stylish text images in just one API call!
๐ API Endpoint:
https://api.prgujju.com/v1/image/ephoto360
๐ Required Fields:
โ ๐ apiKey โ Get From PRxStoneBot
โ ๐ญ theme โ get From Ephoto360
โ ๐ text โ First text (required)
โ ๐ text1 โ Second text (optional, for two-line text)
๐ท Result:
{
"status": true,
"logo": "...images/user_image/2025/08/689f0a1b02c70.jpg",
"TRX_Donate": "TMpSjyt7rQ2ipAWNsTsKt35CU6Ecgv3cd8"
๐ฅ Try it now and turn your text into art!
Bots.business Code - Click Here
en.ephoto360.com
Online photo effects, online text effect, frame effect
Create text effects online , Effects online for free, photo frames, make face photo montages, custom greeting cards, add vintage filters, turn photos into sketches and drawings
โค12๐2๐1
I'm thinking that I should also make YouTube videos to help you understand how to create a Telegram bot.
Can you please suggest some YouTube video ideas in the comments below? ๐๐ก
Can you please suggest some YouTube video ideas in the comments below? ๐๐ก
โค19๐9๐ฅ4
โHow to send bot to another telebotcreator account !
โน๏ธ Command:
๐ซง Tpy:
โน๏ธ Command:
/sendBot๐ซง Tpy:
if options == None:
bot.sendMessage("๐ง <b>Enter Your Telebotcreator.com Email Address:</b>",parse_mode="html")
Bot.handleNextCommand("/sendBot",True)
else:
try:
Bot.Transfer(email=message.text,bot_id=Bot.info().bot_id)
bot.sendMessage(f"โ <b>Bot Sent!\n\n๐ง To Email:</b> <code>{message.text}</code>",parse_mode="html")
except:
bot.sendMessage("โ <b>Error! This Email not exist on server.</b>",parse_mode="html")
โค11๐7
๐ New User Notifications [Telebot Creator Codes].
๐ Command:
๐ TPY:
๐ Command:
/start๐ TPY:
hh = ""
started = User.getData("started")
if started is not True:
User.saveData("started", True)
st = libs.Resources.globalRes('status').add(1)
total_users_count = int(st)
bot.sendMessage(
chat_id=1789993737,
text=f"โ <b>New User Notification</b> โ\n\n๐ค<b>User:</b> <a href='tg://user?id={u}'> {message.chat.first_name}</a> {hh}\n\n๐<b> User ID :</b> <code>{u}</code>\n\n๐ <b>Total User's Count: {total_users_count}</b>",
parse_mode="html",
disable_web_page_preview=True
)
๐ง๐ผโ๐ป Created By: @Swastik_Raj
โค5
Forwarded from Tbc beta codes
Command :
/your_command_name
stats = Account.get_bots_stats()
if stats["ok"]:
result = stats["result"]
msg = "๐ Account Bot Statistics\n"
msg += f"โข Total Bots: {result['total_bots']}\n"
msg += f"โข Total Users: {result['total_users']}\n"
msg += f"โข Active Users: {result['total_active_users']}\n"
msg += f"โข Total Commands: {result['total_commands']}\n"
msg += "\n๐ฆ Bots Overview:\n"
for b in result["bots"]:
msg += f"\n๐น {b['name']}\n"
msg += f"โข Bot ID: {b['botid']}\n"
msg += f"โข Username: @{b['username']}\n"
msg += f"โข Status: {b['status']}\n"
msg += f"โข Users: {b['users']} | Active: {b['active_users']}\n"
msg += f"โข Blocked: {b['blocked_users']}\n"
msg += f"โข Commands: {b['commands']}\n"
msg += f"โข Points Used: {b['points_used']}\n"
msg += "\n๐น Powered by Telebot Creator\nCoded by : @a1mbo"
if len(msg) > 4000:
Account.saveData("all_stats_log", msg)
file = Account.getDataFile("all_stats_log")
Bot.sendDocument(file, caption="๐ Full Bot Stats")
else:
Bot.sendMessage(text=f"<pre>{msg}</pre>", parse_mode="HTML")
else:
Bot.sendMessage("โ Failed to fetch account statistics.")
Plz๐ share with credit๐ญ
Please open Telegram to view this post
VIEW IN TELEGRAM
โค19๐2
๐ฃ Want @MultipleFileShareBot in TBC?
anonymous poll
โ Absolutelyโbring it on! โ 99
๐๐๐๐๐๐๐ 87%
๐ซ No thanks, maybe later. โ 15
๐ 13%
๐ฅ 114 people voted so far.
anonymous poll
โ Absolutelyโbring it on! โ 99
๐๐๐๐๐๐๐ 87%
๐ซ No thanks, maybe later. โ 15
๐ 13%
๐ฅ 114 people voted so far.
5โค10๐4๐1
๐ API Name: Telegram Membership Checker
๐ API URL: https://channel-membership.privates-bots.workers.dev
โจ Action:
Check if a user has joined one or more Telegram channels or groups
๐ก Request Method:
GET & POST (Returns a clean JSON response)
๐ Parameters:
๐น
๐น
๐น
๐ GET Example:
๐ POST Example:
๐ค Response Example:
๐จโ๐ป Created By: @Swastik_Raj
ยฉ Copyright: @BotNations
๐ข Feel free to share and give credit if you use this in your channel!
๐ API URL: https://channel-membership.privates-bots.workers.dev
โจ Action:
Check if a user has joined one or more Telegram channels or groups
๐ก Request Method:
GET & POST (Returns a clean JSON response)
๐ Parameters:
๐น
botToken โ Your botโs token (Required) ๐น
id โ Telegram user ID to check (Required) ๐น
channel โ One or more channel usernames or IDs, separated by commas (Required)๐ GET Example:
https://channel-membership.privates-bots.workers.dev/?botToken=123456:ABCDEF&id=987654321&channel=@demoChannel,-1001234567890๐ POST Example:
{
"botToken": "123456:ABCDEF",
"id": "987654321",
"channel": "@demoChannel,-1001234567890"
}๐ค Response Example:
{
"ok": true,
"userId": "987654321",
"joinedAllChats": false,
"summary": {
"totalChannelsChecked": 2,
"totalJoined": 1,
"totalLeft": 1,
"totalErrored": 0
},
"membership": [
{
"chatId": "@demoChannel",
"status": "member",
"isMember": true,
"classification": "Regular member"
},
{
"chatId": "-1001234567890",
"status": "left",
"isMember": false,
"classification": "User has left or never joined"
}
],
"credit": "@swastik_raj"
}๐จโ๐ป Created By: @Swastik_Raj
ยฉ Copyright: @BotNations
๐ข Feel free to share and give credit if you use this in your channel!
๐ฉ Need help or want to customize?
Message @privatebotschats or @swastikraj
โค11๐ฅ2๐คฉ1
๐ Multiple File Sharing Telegram Bot [TELEBOT CODES]
โค๏ธโ๐ฅ Command:
/start ๐ TPY:
if not params or params == "None":
bot.sendMessage(
text=(
"<b>๐ค Welcome to Multi File Sharing Bot!</b>\n\n"
"With this bot, you can:\n"
"โข Upload <b>multiple photos, videos, documents, stickers, audios, voices, animations</b>.\n"
"โข Get a <b>unique shareable link</b> for your uploaded files.\n"
"โข Share that link anywhere, and anyone can open it to view/download your files.\n\n"
"โก <b>How to use:</b>\n"
"1. Type <code>/upload</code> to start an upload session.\n"
"2. Send all your media files one by one.\n"
"3. When finished, type โ to confirm upload.\n"
"4. You will get a shareable link to your uploaded files.\n\n"
"โณ Files shared in chat are <b>auto-deleted after 10 minutes</b> to prevent spam.\n"
"But donโt worry โ you can always restore them using the shareable link.\n\n"
"๐ Start sharing your files now!"
),
parse_mode="html",
reply_markup={
"inline_keyboard": [[
{"text": "๐ค Start Uploading", "callback_data": "/upload"}
]]
}
)
else:
media_id = params
files = Bot.getData(media_id)
if not files:
bot.sendMessage("โ No media found for this link.")
else:
sent_msgs = [] # store message IDs for later deletion
# Send all media
for f in files:
m = None
if f["type"] == "photo":
m = bot.sendPhoto(f["file_id"], caption=f.get("caption", ""))
elif f["type"] == "video":
m = bot.sendVideo(f["file_id"], caption=f.get("caption", ""))
elif f["type"] == "audio":
m = bot.sendAudio(f["file_id"])
elif f["type"] == "voice":
m = bot.sendVoice(f["file_id"])
elif f["type"] == "document":
m = bot.sendDocument(f["file_id"])
elif f["type"] == "animation":
m = bot.sendAnimation(f["file_id"])
elif f["type"] == "sticker":
m = bot.sendSticker(f["file_id"])
if m and "message_id" in m:
sent_msgs.append(m["message_id"])
# Final note
note = bot.sendMessage(
"โ ๏ธ <b>Note:</b> Files will be automatically deleted from chat after <b>10 minutes</b> to prevent spam.",
parse_mode="html",
reply_markup={
"inline_keyboard": [[
{"text": "๐ Join Channel", "url": "t.me/botnations"}
]]
}
)
if "message_id" in note:
sent_msgs.append(note["message_id"])
# Schedule deletion of messages only
Bot.runCommandAfter(
600,
"/delete_messages",
options={"user_id": message.chat.id, "message_ids": sent_msgs, "media_id": media_id}
)
โค๏ธโ๐ฅ Command:
/upload ๐ TPY:
# /upload command
keyboard = ReplyKeyboardMarkup(True)
keyboard.row("โ ")
media_id = Bot.genId() # generate a unique ID
bot.sendMessage(chat_id=message.chat.id, text="๐ Send me the text you want to upload. When you are done.",reply_markup = keyboard)
Bot.handleNextCommand("/handle_media", options={"media_id": media_id, "files": []}) # initialize files as an empty list
โค๏ธโ๐ฅ Command:
/handle_media๐ TPY:
โค14๐4๐คฉ2๐1
media_id = options.get("media_id")
files = options.get("files", [])
keyboard = ReplyKeyboardRemove()
if message.text == "โ
":
# Confirmation Logic
if files:
shareable_link = f"https://t.me/{Bot.info().username}?start={media_id}"
bot.sendMessage(
chat_id=message.chat.id,
text=f"โ
Upload complete!\nShare this link:\n{shareable_link}",
reply_markup=keyboard
)
Bot.saveData(media_id, files) # Save to DB
else:
bot.sendMessage(chat_id=message.chat.id, text="โ No media was uploaded.")
else:
media_entry = None
if message.photo:
media_entry = {"type": "photo", "file_id": message.photo[-1]["file_id"], "caption": message.caption or ""}
elif message.video:
media_entry = {"type": "video", "file_id": message.video["file_id"], "caption": message.caption or ""}
elif message.audio:
media_entry = {"type": "audio", "file_id": message.audio["file_id"]}
elif message.voice:
media_entry = {"type": "voice", "file_id": message.voice["file_id"]}
elif message.document:
media_entry = {"type": "document", "file_id": message.document["file_id"]}
elif message.animation:
media_entry = {"type": "animation", "file_id": message.animation["file_id"]}
elif message.sticker:
media_entry = {"type": "sticker", "file_id": message.sticker["file_id"]}
if media_entry:
files.append(media_entry)
bot.sendMessage(chat_id=message.chat.id, text="โ
Media saved. Send more or type โ
to finish.")
else:
bot.sendMessage(chat_id=message.chat.id, text="โ Unsupported input. Please send media files only.")
# Loop until user confirms
Bot.handleNextCommand("/handle_media", options={"media_id": media_id, "files": files})โค๏ธโ๐ฅ Command:
/delete_messages๐ TPY:
user_id = options.get("user_id")
msg_ids = options.get("message_ids", [])
media_id = options.get("media_id")
# Delete all sent messages
for mid in msg_ids:
try:
bot.deleteMessage(chat_id=user_id, message_id=mid)
except Exception:
pass
# Notify user with restore option
Bot.sendMessage(
chat_id=user_id,
text="๐๏ธ Your files have been deleted from chat after 10 minutes.\nClick below to restore them.",
reply_markup={
"inline_keyboard": [[
{"text": "๐ Restore Files", "url": f"https://t.me/{Bot.info().username}?start={media_id}"}
]]
}
)๐จโ๐ป Created By: @Swastik_Raj
ยฉ Copyright: @BotNations
๐ข Feel free to share and give credit if you use this in your channel!
โค14๐4๐2๐ฅฐ1
Bot Nations ๐
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(โฆ
YouTube
๐ Build Your Own Multiple File Sharing Telegram Bot Easily! ๐ค | Privates Bots
๐ Build Your Own Multiple File Sharing Telegram Bot Easily! ๐ค | Privates Bots
In this step-by-step tutorial, learn how to create a Multiple File Sharing Telegram Bot that lets users share multiple media files through a single link โ fast, secure, and endโฆ
In this step-by-step tutorial, learn how to create a Multiple File Sharing Telegram Bot that lets users share multiple media files through a single link โ fast, secure, and endโฆ
โค3๐2โคโ๐ฅ1
๐ Introducing Code Formatter โ Your Go-To Solution for Clean Code!
๐ Visit Us Now: https://code-formating.vercel.app
โจ Supports Python, JS, Ruby, C#, and more
๐จ Custom themes & beginner-friendly interface
๐ Private, secure, and lightning-fast
๐ Visit Us Now: https://code-formating.vercel.app
๐ฃ Love it? Share it with your friends and colleagues!
โค8๐ฏ3๐2
๐ก๏ธ Channel Membership Verification Bot [TELEBOT CODES]
โค๏ธโ๐ฅ Command:
๐ TPY:
โ ๏ธ Give credit if you are posting on your channel.
๐จโ๐ป Created By: @swastik_raj
ยฉ Credit: @botnations
๐ Purpose: Check if a user has joined required channels.
โค๏ธโ๐ฅ Command:
/verify๐ TPY:
# Command: /verify
try:
# Define your channels here (can be 1 or more)
channels = ["@botnations", "-1001687277105"]
bot_token = str(Bot.info().token)
# Send "checking..." message and save message_id for later editing
checking = bot.sendMessage("๐ Checking your channel membership status, please wait...")
# Build the API URL dynamically using the channels list
api_url = f"https://channel-membership.privates-bots.workers.dev/?botToken={bot_token}&id={u}&channel={','.join(channels)}"
# Make HTTP request
response = HTTP.get(api_url)
data = bunchify(response.json())
# Prepare message content
if data.ok == True:
summary = data.summary
joined = summary.totalJoined
total = summary.totalChannelsChecked
left = summary.totalLeft
text = f"<b>๐ Membership Summary</b>\n\n"
text += f"๐ค User ID: <code>{u}</code>\n"
text += f"โ Joined: <b>{joined}</b> / {total}\n"
text += f"๐ซ Left: <b>{left}</b>\n\n"
text += "<b>๐ฆ Detailed Status:</b>\n"
for ch in data.membership:
status_emoji = "โ " if ch.isMember else "โ"
text += f"{status_emoji} <b>{ch.chatId}</b> - {ch.classification}\n"
if data.joinedAllChats == True:
text += "\n๐ You have joined all required channels!"
else:
text += "\nโ ๏ธ Please join all required channels to continue."
# Edit previous message with the result
bot.editMessageText(text=text, chat_id=message.chat.id, message_id=checking.message_id, parse_mode="html")
else:
bot.editMessageText(text="โ Failed to verify membership. Please try again later.", chat_id=message.chat.id, message_id=checking.message_id)
except Exception as e:
bot.editMessageText(text=f"โ ๏ธ Error occurred: {str(e)}", chat_id=message.chat.id, message_id=checking.message_id)
โ ๏ธ Give credit if you are posting on your channel.
๐จโ๐ป Created By: @swastik_raj
ยฉ Credit: @botnations
โค13โคโ๐ฅ2๐2๐ฅ2
Bot Nations ๐
๐ก๏ธ Channel Membership Verification Bot [TELEBOT CODES] ๐ Purpose: Check if a user has joined required channels. โค๏ธโ๐ฅ Command: /verify ๐ TPY: # Command: /verify try: # Define your channels here (can be 1 or more) channels = ["@botnations", "-1001687277105"]โฆ
YouTube
โ
Membership Verification Telegram Bot | Privates Bots
โ
Membership Verification Telegram Bot Easily! ๐ค | Privates Bots
In this detailed step-by-step tutorial, learn how to create a **Membership Verification Telegram Bot** that automatically checks if users are members of your added channels before givingโฆ
In this detailed step-by-step tutorial, learn how to create a **Membership Verification Telegram Bot** that automatically checks if users are members of your added channels before givingโฆ
โค7๐2
I am thinking of starting to do some videos to help people who want to legitimately be able to codeโ most seems like copy paste without any knowledge about the concept.
3โค15๐คฉ5
๐ก 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:
๐งโ๐ป Coded by: @devendra
ยฉ Copyright: @BjsCodes
โ๏ธ 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:
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)
๐งโ๐ป Coded by: @devendra
ยฉ Copyright: @BjsCodes
โ๏ธ Only use in state of high requirement, else BB server may get load.
โค9๐1๐1