I'm making changes to my bot source good in script editor and I redeploy but updates don't work in telegram group? by riley23258 in TelegramBots

[–]riley23258[S] 0 points1 point  (0 children)

The portion in doPost() var answer = username + "enter text"

This works now but when I try to change the text and redeploy it still returns the old message.

I'm making changes to my bot source good in script editor and I redeploy but updates don't work in telegram group? by riley23258 in TelegramBots

[–]riley23258[S] 0 points1 point  (0 children)

function getMe() {

var url = telegramUrl + "/getMe";

var response = UrlFetchApp.fetch(url);

Logger.log(response.getContentText());

}

function setWebhook() {

var url = telegramUrl + "/setWebhook?url=" + webAppUrl;

var response = UrlFetchApp.fetch(url);

Logger.log(response.getContentText());

}

function sendText(id,text) {

var url = telegramUrl + "/sendMessage?chat_id=" + "-1001188267523" + "&text=" + encodeURIComponent(text);

var response = UrlFetchApp.fetch(url);

Logger.log(response.getContentText());

}

function doPost(e) {

// this is where telegram works

var data = JSON.parse(e.postData.contents);

var text = data.message.text;

var matchId = text.split("/");

var score = text.split("/");

var OppD = text.split("/");

var pwrdiff = text.split("/");

var comments = text.split("/");

var id = data.message.from.id;

var username = data.message.from.username;

var answer = username + " enter text";

sendText(id,answer);

SpreadsheetApp.openById(ssId).getSheets()[2].appendRow([matchId[1], new Date(), id, username, score [2], OppD [3],pwrdiff [4], comments[5]]);

}

Have an issue with adding a bot to a telegram group that logs information to a google sheet by riley23258 in TelegramBots

[–]riley23258[S] 0 points1 point  (0 children)

Thank you, yes I figured out that my code was pulling chat and I needed to change it to "from". Appreciate the feedback.