function sendMessage(from_chat_id, text, keyboard, id_msg) { // Отправляет сообщение используя sendMessage
var data = {
method: "sendMessage",
chat_id: String(from_chat_id),
text: text,
parse_mode: "HTML",
reply_markup: JSON.stringify(keyboard),
reply_to_message_id: String(id_msg)
};
var options = {
method: 'POST',
payload: data,
muteHttpExceptions: true
};
var response = UrlFetchApp.fetch('https://api.telegram.org/bot' + token + '/sendMessage', options);
console.log(JSON.parse(response.getContentText(), null, 7))
}
let keyboard_contact = {
keyboard: [
[{
text: "Авторизоваться",
request_contact: true
}]
],
resize_keyboard: true,
one_time_keyboard: true
};
let keyboard_menu_inline = {
inline_keyboard: [
[{
text: "Услуги ",
callback_data: "services"
}, {
text: "Оплата ",
url: "https://google.com",
callback_data: "pay"
}],
[{
text: "Статус ✅ ",
url: "https://google.com"
}, {
text: "Обратная связь ",
callback_data: "support"
}]
]
};
sendMessage(from_chat_id, text, keyboard)