My bot does not send the emails I request!

0

Greetings, I'm losing my hair with a stop here. I am developing a bot on telegram through Apps Script, that Google developer tool, and I'm going through the following problem, I ask pro bot send updates of the telegram to my email, and it just does not do any of this! I will be leaving the code attached so you can analyze calmly, the code apparently is no syntax error, or logic, I fear it is a conflict of getUpdates with setWebhook ...

var token = "TOKEN";
var telegramUrl = "https://api.telegram.org/bot" + token;
var webAppUrl = "https://script.google.com/macros/s/AKfycbyTW4UOWd3fGyP-gPAp7K97y8Ef9OgFfOagDd_QQxwi/exec";
function getMe() {
   var response = UrlFetchApp.fetch(url + "/getMe");
   Logger.log(response.getContentText());
}
function getUpdates() {
   var response = UrlFetchApp.fetch(telegramUrl + "/getUpdates");
   Logger.log(response.getContentText());
function setWebhook() {
  var url = telegramUrl + "/setWebhook?url=" + webAppUrl;
  var response = UrlFetchApp.fetch(url);
  Logger.log(response.getContentText());
}
function doGet(e) {
  return HtmlService.createHtmlOutput("Oii!" + JSON.stringify(e));
}
function doPost(e) {
  var data = JSON.parse(e.postData.contents);
  GmailApp.sendEmail(Session.getEffectiveUser().getEmail(),"ATUALIZAÇÃO WIAT GUARDIAN",JSON.stringfy(data,null,4));
}
    
asked by anonymous 23.03.2018 / 12:56

0 answers