This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Net; | |
| using System.Text.Json; | |
| using System.IO; | |
| using System.Text; | |
| class WaMessageSender | |
| { | |
| // TODO: Replace the following with your gateway instance ID, Forever Green client ID and secret: | |
| private static string INSTANCE_ID = "YOUR_INSTANCE_ID_HERE"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub Main_Routine() | |
| ''' The first parameter is the name of the group | |
| ''' The second parameter is the number of the group admin | |
| ''' The third parameter is the full path to the voice note file (e.g. OPUS file) | |
| ''' The fourth parameter is the filename displayed to the recipient. | |
| ''' The fifth parameter is the caption for the voice note file. | |
| TelegramVoice_GroupSend "Muscle Men Club", "19159876123", "C:\Users\Public\martin-luther-king.opus", "anyname.opus", "I have a dream" ''' TODO: Specify the target group | |
| End Sub | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import base64 | |
| import requests | |
| # TODO: Put down your own Client ID and secret | |
| instanceId = "YOUR_GATEWAY_INSTANCE_ID_HERE" | |
| clientId = "YOUR_OWN_ID_HERE" | |
| clientSecret = "YOUR_OWN_SECRET_HERE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $INSTANCE_ID = 'YOUR_INSTANCE_ID_HERE'; // TODO: Replace it with your gateway instance ID here | |
| $CLIENT_ID = "YOUR_CLIENT_ID_HERE"; // TODO: Replace it with your Premium client ID here | |
| $CLIENT_SECRET = "YOUR_CLIENT_SECRET_HERE"; // TODO: Replace it with your Premium client secret here | |
| $pathToDocument = "/tmp/martin-luther-king.opus"; // TODO: Replace it with the path to your voice note file | |
| $voiceData = file_get_contents($pathToDocument); | |
| $base64VoiceNote = base64_encode($voiceData); | |
| $fn = "anyname.opus"; // TODO: Replace it with any name you like | |
| $caption = "I have a dream"; // TODO: Replace it with an eye-catching caption |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| var http = require('http'); | |
| var fs = require('fs'); | |
| // Put down your own client ID and secret here: | |
| var instanceId = "YOUR_OWN_GATEWAY_INSTANCE_ID"; | |
| var clientId = "YOUR_OWN_CLIENT_ID"; | |
| var clientSecret = "YOUR_OWN_SECRET_ID"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * If you use Maven, add the following to your pom.xml: | |
| * <dependency> | |
| * <groupId>com.google.code.gson</groupId> | |
| * <artifactId>gson</artifactId> | |
| * <version>2.8.0</version> | |
| * </dependency> | |
| * <dependency> | |
| * <groupId>commons-codec</groupId> | |
| * <artifactId>commons-codec</artifactId> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function demoSendOpusToTelegramGroup() { | |
| var group_name = "Muscle Men Club"; // TODO: Specify the name of your group | |
| var group_admin = "12025550108"; // TODO: Specify the number of the group admin | |
| var opusFilename = "martin-luther-king.opus"; // TODO: This file must be uniquely named and, of course, exist in your Google Drive!!! | |
| var filename = "anyname.opus"; // TODO: Use any name you like | |
| var caption = "I have a dream"; // TODO: Use any caption you like | |
| var opusBase64 = base64encodeFileByName(opusFilename); | |
| if (opusBase64 == null) { | |
| Logger.log("Abort! OPUS file error: " + opusFilename); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Net; | |
| using System.Web.Script.Serialization; // requires the reference 'System.Web.Extensions' | |
| using System.IO; | |
| using System.Text; | |
| class TelegramGroupOpusSender | |
| { | |
| // TODO: Replace the following with your gateway instance ID, client ID and secret! | |
| private static string INSTANCE_ID = "YOUR_INSTANCE_ID"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ####################################################################### | |
| # You will need to have the utility `base64` available on your Linux | |
| # system to run this script. | |
| # | |
| # To install it: | |
| # sudo apt-get install coreutils | |
| ####################################################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub Main_Routine() | |
| ''' The first parameter is the name of the group | |
| ''' The second parameter is the number of the group admin | |
| ''' The third parameter is the full path to the audio file (e.g. MP3 file) | |
| ''' The fourth parameter is the filename displayed to the recipient. | |
| ''' The fifth parameter is the caption for the audio file. | |
| TelegramAudio_GroupSend "Muscle Men Club", "19159876123", "C:\Users\Public\ocean-waves.mp3", "anyname.mp3", "Enjoy the nature" ''' TODO: Specify the recipient's number here. NOT the gateway number | |
| End Sub | |