I want to make telegram bot using BJs, I used Bots.Business Platform to create telegram bot. I hope you understand bots.business bot function and user function etc. now currently we build force join telegram message. Use like this example welcome message with professional text with bold and Emoji also. Here is just example "// see all parameters in https://core.telegram.org/bots/api#sendphoto
Api.sendPhoto({
photo: "https://cataas.com/cat", // it is picture!
caption: "Test photo",
reply_markup: { inline_keyboard: [
// line 1
[
// open the link on button pressing
{ text: "button1", url: "http://example.com" },
// run command /onButton2 on button pressing
{ text: "button2", callback_data: "/onButton2" }
],
// line 2
[
// see all params in
// https://core.telegram.org/bots/api#inlinekeyboardbutton
{ text: "button3", callback_data: "/onButton3" }
]
]}
});" I need total 5 buttons. Per one line have must be 2 buttons only with text "𝐉𝐎𝐈𝐍" after next line also have 2 buttons with same name. But last 5th buttons name is "𝐉𝐎𝐈𝐍𝐄𝐃" here is my simple start button but make it I provide code with image "var button =[
[
{
text: "✘ TeleService",
url: "https://t.me/Teleservices_Api"
},
{
text: "✘ TeleService",
url: "https://t.me/Teleservices_Bots"
}
],
[
{
text: "Refresh",
callback_data: "/joined"
}
]
]
var mes = "<b>ᴘʟᴇᴀꜱᴇ ᴊᴏɪɴ ᴍʏ ᴜᴘᴅᴀᴛᴇꜱ ᴄʜᴀɴɴᴇʟ ᴛᴏ ᴜꜱᴇ ᴛʜɪꜱ ʙᴏᴛ\n\nᴅᴜᴇ ᴛᴏ ᴏᴠᴇʀʟᴏᴀᴅ, ᴏɴʟʏ ᴄʜᴀɴɴᴇʟ ꜱᴜʙꜱᴄʀɪʙᴇʀꜱ ᴄᴀɴ ᴜꜱᴇ ᴛʜᴇ ʙᴏᴛ</b>"
Api.sendMessage({
text: mes,
parse_mode: "html",
reply_markup: { inline_keyboard: button }
});" after this is /joined command bjs "if(!content){
var url = "https://api.teleservices.io/Membership/"
var channel = ["@Teleservices_Api","Teleservices_Bots"]; // Your channel's username with or without "@"
var token = bot.token;
HTTP.get({
url:
""+url+"?bot_token=" +token +"&user_id=" +
user.telegramid +
"&chat_id=" +
channel +
"",
success: "/joined"
});
}
else{
var data = JSON.parse(content);
var status = data.status;
var isJoined = data.is_joined;
if (status === "true") {
if (isJoined === true) {
Bot.sendMessage("Thanks For Joining All Channels✅");
Bot.runCommand("/main") //Your Command runAfter joining all channel
} else {
if (data.not_joined_chat && data.not_joined_chat.length > 0) {
let channels = data.not_joined_chat.map(chat => `@${chat}`).join(', ')
if (request.data) {
Api.answerCallbackQuery({
callback_query_id: request.id,
text: `❌ Must Join Channel To Use Bot 🤖 ${channels}`,
parse_mode: "html",
show_alert: true
});
}
} else {
Bot.sendMessage("No channels to join or an error occurred.");
}
}
} else {
Bot.sendMessage("Invalid response status.");
}}"
Comments
Post a Comment