Host your Telegram BOT on Google App Script.
- Visit script.google.com/start to open the script editor.
- Delete any code in the script editor and paste in the code in Code.gs
- Replace var of
token
with your bot token. - Select the menu item File > Save. Name your new script and click OK.
- Select Publish > Deploy as web app.
- Under Project version, select New.
- Under Execute the app as, select your account.
- Under Who has access to the app, select "Anyone, even anonymous".
- Click Deploy.
- In the dialog Authorization required, click Review Permissions and click Allow.
- Copy the URL labeled Current web app URL and ends in /exec
- Replace var of
publishUrl
with your Current web app URL - Set up the Webhook by Select the Run menu, select the function setWebhook.
/start #begin bot
/joke #get joke
Original source:
https://gist.github.com/unnikked/828e45e52e217adc09478321225ec3de
Reference:
- https://github.com/ocordova/gas-telegram-bot