eljojo / telegram_bot

A charismatic Ruby client for Telegram's Bot API
MIT License
298 stars 82 forks source link

Making requests when getting updates #9

Open 9px opened 9 years ago

9px commented 9 years ago

hi. telegram recently add an ability to perform a request to the telegram Bot API while sending an answer to the webhook. can you do a simple implement of this feature in your bot?

eljojo commented 9 years ago

Hi, I haven't read about this. I'll try to get some time this week to read about this!

Any PRs are welcome :)

solyarisoftware commented 9 years ago

I agree with @9px request, a webhook example could help, maybe a very simple sinatra example

BTW, generally speaking, the HTTP long polling seems to me a not great solution in terms of resources efficency; maybe a SSE (Server Sent Events) could be better... anyway the choice is between HTTP long polling ( https://core.telegram.org/bots/api#getting-updates ) vs HTTP webhooks ( https://core.telegram.org/bots/api#setwebhook ). This last case fit maybe better for a bot that could manage a very high troughtput (messages/sec). Telegram Bot API webhooks settings iare not too clear in documentation at my first glance...

Thanks @eljojo for your work, I'll do a PR if I'll be able...!