I\'ve been using telegram_bot, and trying to get groupChat id to send notifications to group chat, but don\'t know which methods I have to use for it.
For getting ch
bot receives the following message originated on a Telegram group having a bot co-existing:
extract data as required
function doPost(e) {
var contents = JSON.parse(e.postData.contents);
// GmailApp.sendEmail(Session.getEffectiveUser().getEmail(), "Telegram Bot Update", JSON.stringify(contents, null, 4));
var chat_id = contents.message.chat.id;
var text = contents.message.text;
var name = contents.message.from.first_name + " " + contents.message.from.last_name;
var sResponse = telegramBotMachine( chat_id, text, name );
}
/* contents
{
"update_id": 20383255,
"message": {
"message_id": 147,
"from": {
"id": 999999999,
"is_bot": false,
"first_name": "Trajano",
"last_name": "Roberto",
"username": "TrajanoRoberto",
"language_code": "en"
},
"chat": {
"id": -666666666,
"title": "Test Ataque Media Flamengo",
"type": "group",
"all_members_are_administrators": true
},
"date": 1585450075,
"text": "Menu"
}
}