Telegram Bot, Google App engine and Webhooks/Polling

312 views
Skip to first unread message

eugene low via StackOverflow

unread,
Jan 4, 2016, 4:42:05 AM1/4/16
to google-appengin...@googlegroups.com

I've wrote a bot using the pyTelegramBotAPI which follows the tutorial here and managed to get it running on Telegram. https://github.com/eternnoir/pyTelegramBotAPI

Now I want to deploy this app on Google App Engine, however, I am not sure how to go about it. I don't understand what is webhooks/polling and why I need flask/bottle and how to get SSL etc.

If anyone could point me towards a step by step guide on how to deploy my app (on any servers), I would be very grateful.

Thank you



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/34588182/telegram-bot-google-app-engine-and-webhooks-polling

Nick Lee via StackOverflow

unread,
Jan 4, 2016, 10:32:08 AM1/4/16
to google-appengin...@googlegroups.com

If you lack those background knowledge and want to deploy your bot on Google App Engine, I think you should consider this project. It is built specifically for Google App Engine, and has detailed instructions on how to set up a bot on there.

As for your more general questions ...

Webhook vs Polling: There are two ways to obtain updates. You may access the Bot API's getUpdates method over and over - this is called polling - or you may tell Telegram to actively send updates to a specified URL (in the form of an HTTPS POST request). This URL is called a webhook.

In the case of polling, the bot pulls updates from Telegram servers. In the case of webhook, Telegram servers push updates to the bot.

A webhook responds to HTTPS requests, so it is essentially a web application. Flask is a framework that helps you make web applications.

Google App Engine is a service that hosts web applications. If you want to deploy a bot on Google App Engine, it is likely a webhook (although it does not have to be - a web application can still use polling to obtain updates).

If you use Google App Engine to host your webhook, you don't have to bring your own SSL certificate, unless you want to use a custom domain. If your webhook is hosted by another service provider, the procedure of setting up SSL certificates varies. I don't have enough experience in this matter to say more, though.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/34588182/telegram-bot-google-app-engine-and-webhooks-polling/34594466#34594466
Reply all
Reply to author
Forward
0 new messages