This article shows you how to send a an image to a Telegram user from a Google Apps Script.
Before the recipient can receive your Telegram message, she will need to register with the WhatsMate Telegram Gateway. Instructions are available on the official site. Unregistered users will NEVER receive messages from the Gateway.
To send a Telegram message from a Google Apps Script, do this:
- First, learn how to send a simple text message on the official site.
- With the above knowledge, you can now download our sample code.
- Copy the following source code to your Apps Script project.
- Customize the TODO lines:
- Specify your gateway instance ID on line 18.
- Specify your client ID and secret on lines 19 and 20.
- Specify your target recipient on line 3. Remember to include the country code.
- Specify the filename of your image on line 4.
- Run the function
demoSendTelegramImageInDrive()to send your message.
You will need a trial account to call the above API. Go sign up now.