Open mbino94 opened 2 years ago
hi there! as far as I see, your script missing }} in the end (if statement not closed and doPost function not closed)
.from.id;
the }} are in the script, bu i just forgot them in the comment,
ive tried to catch the error
and got that .from.id is undefined which are in the line var target = contents.massage.reply_to_message.from.id;
but they are defined in the object as you see in the screenshot
var target = contents.mAssage.reply_to_message.from.id; there is typo in contents.massage. should be message
yea, ive fixed that and catched the error after that
Hello sir. im facing an issue , hope you can help every time i Create a variable that contains a special character like ( _ or @ )my script stops working for example:
var target = contents.massage.reply_to_message.from.id;
if add this line to my script the script stops workingmy full script is here ' function setWebhook() { var url = telegramUrl + "/setWebhook?url=" + webAppUrl; var response = UrlFetchApp.fetch(url); }
function sendMessage(id, text,) { var url = telegramUrl + "/sendMessage?chat_id=" + id + "&text=" + text; sponse = UrlFetchApp.fetch(url); }
function doPost(e) { var contents = JSON.parse(e.postData.contents); var id = contents.message.from.id; var text = contents.message.text; var target = contents.massage.reply_to_message.from.id;
if (text.includes("/who")) { sendMessage(id, "it is " + target+ " :) " );