📣
Super Fast Broadcast Code with API (
v2.1.0)
📌
Command:- /start
➡️
BJ's:- var sdone = User.getProperty("sdone")
if(!sdone){
var accessToken = "Your Bot's Access Token" //generate by below method
HTTP.post({
url: "https://api.projectoid.site/v1/telegram/botpanel/adduser.php",
body: {
bot_id: bot.token.split(":")[0],
access_token: accessToken,
user_id: user.telegramid
},
background:true
})
User.setProperty("sdon",true,"string")
}
📌
Command :- /broadcast
✔️ Wait For answer :- On
💬
Message :- Kindly Enter Your Message To Broadcast
➡️ BJ's:-var accessToken = "Your Bot's Access Token" //Generate from projectoid.site/services/telegram/bot/register
var admin = "Your Telegram id" //get by Bot.sendMessage(user.telegramid)
if (user.telegramid == admin) {
try {
var msg = message
function broadcast(type, method, cap, fileid) {
HTTP.post({
url: "https://api.projectoid.site/v1/telegram/botpanel/broadcast.php",
headers: { "content-type": "application/json" },
body: {
method: method,
text: cap,
access_token: accessToken,
bot_token: bot.token,
admin: user.telegramid,
type: type,
file_id: fileid,
caption: cap,
parseMode: "html", //you can change it to Markdown
disableWebPreview: true,
protectContent: false //pass true if you don't allow to forward/save message
}
})
}
var boarding = "
Broadcast By Admin \n\n"
var caption = !request.caption
? boarding
: boarding + "
Message = " + request.caption
if (request.photo[0]) {
broadcast("photo", "sendPhoto", caption, request.photo[0].file_id)
return
}
if (request.text) {
broadcast(
"text",
"sendMessage",
"
Broadcast By Admin \n\n
Message = " + message,
null
)
return
}
if (request.video) {
broadcast("video", "sendVideo", caption, request.video.file_id)
return
}
if (request.audio) {
broadcast("audio", "sendAudio", caption, request.audio.file_id)
return
}
if (request.document) {
broadcast("document", "sendDocument", caption, request.document.file_id)
return
}
if (request.sticker) {
broadcast("sticker", "sendSticker", null, request.sticker.file_id)
return
}
if (request.animation) {
broadcast(
"animation",
"sendAnimation",
caption,
request.animation.file_id
)
return
}
if (request.voice) {
broadcast("voice", "sendVoice", caption, request.voice.file_id)
return
}
if (request.video_note) {
broadcast("video_note", "sendVideo", caption, request.video_note.file_id)
return
}
} catch (err) {
Bot.sendMessage(
err + "\n\n*Please Reach out
@BjsCodesChat with Error Screenshot.*"
)
}
return
}
Bot.sendMessage("*You are Not a Admin*")
❓
How to Get Access Token?
👉
Get Access Token for Your Bot from projectoid.site/services/telegram/bot/register by Pasting your Bot Token!
©️
Copyright :- @BjsCodes
🤩 Api By :-
@Projectoid
👩💻 Code
by :-
@Coder_kevin
🆘 Api Docs :- doc.projectoid.site
✍️ Setup :- https://youtu.be/jr11mQe0zLw