You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.
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}
The text was updated successfully, but these errors were encountered: