Telegram API with Google Apps Script

I am looking for an example Telegram API using Google Apps Script, or someone / something that can help me find out how to use this API, for example, to send a message to a specific user

+7
google-apps-script telegram
source share
2 answers

I actively track Google Apps Script examples, and I don’t know the samples integrated into the Telegram API. Given the level of security encryption required by the Telegram API , I would suggest that integration with this service is unlikely due to the limitations of Script applications.

I did not find examples of sending messages to the user, but the Telegram service posted a large amount of code, including their web client code, on Github , and this seems like the best starting point.

Update: Telegram created a Bot API that allows you to run third-party scripts in Telegram. Advantage of the Bot API: You do not need to encrypt messages. Sample PHP code could be easily ported to Script applications.

+3
source share

I was looking for something like this and could not find anyone, so I made my own, I will write it here, maybe someone will use it.

This is a simple proof of concept that works:

function sendTelegramNotification(botSecret, chatId, body) { var response = UrlFetchApp.fetch("https://api.telegram.org/bot" + botSecret + "/sendMessage?text=" + encodeURIComponent(body) + "&chat_id=" + chatId + "&parse_mode=HTML"); } 

Other teams can be made equally.

+1
source share

All Articles