veikus / ingresshelper

Telegram bot that sends intel screenshot in reply of location
86 stars 29 forks source link

How to get the request from telegram? #5

Closed trainchou closed 9 years ago

trainchou commented 9 years ago

I am just curious. And I am totally green with Chrome extension.

May I ask how a Chrome extension get a request from a telegram client?

And do you create @BotFather ?

Thank you!

veikus commented 9 years ago

Hi @trainchou, Extension creates special page, called "background". You don't see it, but when you start browser it's automatically created (just believe me). This page has bot's javascript code. Every few seconds browser makes requests to telegram server and receive new messages. You can open extensions page in browser, click "Inspect views: background page", than go to "Network" tab and you will see requests sent to telegram servers.

No, @BotFather made by telegram team.