This article shows you how to send a voice note file (e.g. an OPUS file) to a registered Telegram group from a Google Apps Script.
To send a Telegram message containing a voice note file from a Google Apps Script, do this:
- First, learn how to send a simple text message to a group on the official site.
- With the above knowledge, you can now download our sample code.
- Copy the following source code to your Google Apps Script project.
- Customize the TODO lines:
- Specify your gateway instance ID on line 19.
- Specify your client ID and secret on lines 20 and 21.
- Specify your target group on lines 2 and 3.
- Specify your OPUS file on line 4.
- Run the function
demoSendOpusToTelegramGroup()
to send your first OPUS file to your group.
You will need a trial account to call the above API. Go sign up now.