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

pay #3

Description

@along993319

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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions