Answer the question
In order to leave comments, you need to log in
Google Apps Script Telegram Bot editing old messages?
I'm trying to save the id and text of the message to a global variable.
I want to have access to them later to edit
Here is the code:
let id_messages = {};
function doPost(e) {
const contents = JSON.parse(e.postData.contents);
const key = contents.message.from.id;
const value = contents.message.message_id;
id_messages[key] = value;
switch (contents.message.text) {
case "/start":
id_messages.forEach(item => {
bot.sendText(contents.message.from.id, item);
});
break;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question