Closed danielperez9430 closed 2 years ago
Use examples:
bot.setChatMenuButton({
chat_id: msg.chat.id,
menu_button: JSON.stringify({ type: "web_app", text: "Hello", web_app: { url: "https://webappcontent.telegram.org/cafe" } })
})
.then(res => {
console.log("Result -> " + res);
})
// Optional parameter "{ chat_id : msg.chat.id }"
bot.getChatMenuButton().then(res => {
console.log("ChatMenuButton -> ", res);
})
bot.setMyDefaultAdministratorRights({
rights: JSON.stringify({
can_manage_chat: true,
can_change_info: true,
can_delete_messages: false,
can_invite_users: true,
can_restrict_members: false,
can_pin_messages: true,
can_promote_members: false,
can_manage_video_chats: false,
is_anonymous: false
}),
for_channels: false
})
.then(res => {
console.log("Set success? -> " + res);
bot.getMyDefaultAdministratorRights({ for_channels: false }).then(res => {
console.log("MyDefaultAdministratorRights -> ", res);
})
})
Open a web bot from keyboard / inline button:
bot.sendMessage(msg.chat.id, "Open web bot with your keyboard button",
{
reply_markup: {
keyboard: [[
{
text: "Open simple mode",
web_app: { url: "https://webappcontent.telegram.org/cafe" }
}
]],
}
}
)
bot.sendMessage(msg.chat.id, "Open web bot with button below",
{
reply_markup: {
inline_keyboard: [[
{
text: "Open demo",
web_app: { url: "https://webappcontent.telegram.org/cafe" }
}
]],
}
}
Add method setChatMenuButton()
Add method getChatMenuButton()
Add method setMyDefaultAdministratorRights()
Add method getMyDefaultAdministratorRights()
Add method answerWebAppQuery()
Renamed the fields voice_chat_scheduled, voice_chat_started, voice_chat_ended, and voice_chat_participants_invited to video_chat_scheduled, video_chat_started, video_chat_ended, and video_chat_participants_invited
Tests:
answerWebAppQuery
setChatMenuButton
getChatMenuButton
setMyDefaultAdministratorRights
getMyDefaultAdministratorRights
npm run doc
Description
Telegram Bot API 6.0
References