-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbot_code.gs
More file actions
35 lines (32 loc) · 760 Bytes
/
bot_code.gs
File metadata and controls
35 lines (32 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const token = '154354351435:AFGAFGAFDGFGAFDGAFGAFGAFGAFGAFDG';
const myBot = new TelegramApp(token, true);
const type = myBot.Type();
function main(update) {
// do something
var message = type.Message(
type.Update(update).message
);
myBot.sendMessage({
chat_id: message.chat.id,
text: 'Ку-ку!',
reply_markup: type.InlineKeyboardMarkup({
inline_keyboard: [[
type.InlineKeyboardButton({
text: 'Да!',
callback_data: 'yes'
}),
type.InlineKeyboardButton({
text: 'Нет!',
callback_data: 'no'
})
]]
})
});
}
function setTgWebhook() {
myBot.setWebhook({
url: 'webhook_url',
max_connections: 1,
drop_pending_updates: true
});
}