Telegram Bot, Google Apps Script, Keyboard Markup


Telegram Bot, Google Apps Script, Keyboard Markup


function Keyboard (id, text, keyboard ){
var url = telegramUrl + "/sendMessage?chat_id=" + id + "&text=" + text + "&reply_markup=" + keyboard ;
var response = UrlFetchApp.fetch(url);
Logger.log(response.getContentText());
}

function doPost(e) {
// this is where telegram works
var data = JSON.parse(e.postData.contents);
var text = data.message.text;
var id = data.message.chat.id;

if (text == "/start"){
var message = "Selamat datang. Untuk mencari data pelanggan silahkan memasukkan @ODP_NAME.%0AContoh : @ODP-UBN-FAC/100";
var tt = "hi";
var keyboard = JSON.stringify({"keyboard":[["Yes"],["No"]]});
sendText(id,message);
Keyboard(id, tt, keyboard);
}



i just want to make like in this Picture



What's wrong with my code? I just want to make my telegram bot showing keyboard markup as I wish, but I can't understand how to use the telegram api of keyboardmarkup.



**The keyboard function cannot run, is it wrong use of replykeyboardmarkup?
**





You need to describe the problem that you're experiencing.
– Diego
2 days ago





the point is i want to show custom keyboard, and i can't understand how to implement the reply keyboard markup telegram bot using google apps script
– Dwima Gita Dirtana
2 days ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

how to run turtle graphics in Colaboratory

Export result set on Dbeaver to CSV