You can use this script to bypass the bans on Telegram API by different hosts. Simply send the request to this script instead of the Telegram Bot API after deploying it as a web app and allowing anonymous access.
It accepts bot GET and POST requests with the following params
name | type | Description |
---|---|---|
bot_token |
String | The Telegram Bot Token |
method |
String | Telegram Bot API method name e.g. sendMessage |
args |
JSON Object | The arguments/params for the API method e.g. {"chat_id":"123","text":"HelloWorld"} |
- Goto script.google.com and sign in if required.
- Create a new project and give it a name you love :)
- It should open a file (Code.gs by default). Remove the contents of this file.
- Copy the contents of wptelegram-google-script.gs below and paste into your project file (Code.gs)
- Click File > Save or press
Ctrl+S
- Click "Publish" from the menu and select "Deploy as web app..."
- If asked, Enter any name for the project and click "OK"
- In "Execute the app as:", select "Me (<your email>)" [IMPORTANT]
- In "Who has access to the app:", select "Anyone, even anonymous" [IMPORTANT]
- Click "Deploy" to open the Authorization box.
- Click "Review Permissions" to authorize the script.
- In the popup window select your Google Account.
- On the next screen, click "Allow".
- After redirection, you should see "This project is now deployed as a web app."
- Copy the "Current web app URL:" and paste it in your app or plugin