telegram-bot-gscript icon indicating copy to clipboard operation
telegram-bot-gscript copied to clipboard

pay

Open along993319 opened this issue 4 years ago • 0 comments

function doPost(e){ var estringa = JSON.parse(e.postData.contents); var payload = identificar(estringa); var data = { "method": "post", "payload": payload } UrlFetchApp.fetch("https://api.telegram.org/botYOUR-API-HERE/", data);} function identificar(e){ if (e.message.text){ var mensaje = { "method": "sendMessage", "chat_id": e.message.chat.id, "text": e.message.text, } } else if (e.message.sticker){ var mensaje = { "method": "sendSticker", "chat_id": e.message.chat.id, "sticker": e.message.sticker.file_id } } else if (e.message.photo){ var array = e.message.photo; var text = array[1]; var mensaje = { "method": "sendPhoto", "chat_id": e.message.chat.id, "photo": text.file_id } } else { var mensaje = { "method": "sendMessage", "chat_id": e.message.chat.id, "text": "Try other stuff" } } return mensaje}

along993319 avatar Sep 19 '21 23:09 along993319