Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

pay #3

Open
along993319 opened this issue Sep 19, 2021 · 0 comments
Open

pay #3

along993319 opened this issue Sep 19, 2021 · 0 comments

Comments

@along993319
Copy link

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}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant