Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up webhooks with telegram-bot-ruby ? #19

Closed
thibauld opened this issue Sep 29, 2015 · 11 comments
Closed

Setting up webhooks with telegram-bot-ruby ? #19

thibauld opened this issue Sep 29, 2015 · 11 comments

Comments

@thibauld
Copy link

From the examples, it looks like telegram-bot-ruby supports only the polling method for getting updates. Does it support also the webhook method ?

@thibauld thibauld changed the title Using webhooks with telegram-bot-ruby ? Setting up webhooks with telegram-bot-ruby ? Sep 29, 2015
@atipugin
Copy link
Owner

Unfortunately, gem doesn't support webhooks at the moment. I think it would be easier to handle webhooks by setting up your own simple web app (using Sinatra, for example). You still may use this gem for making api calls or whatever from there.

@thibauld
Copy link
Author

thibauld commented Oct 1, 2015

Ok, I will do that and provide you with an example that you can include in your README if you want.

@solyarisoftware
Copy link

Yes @thibauld, a webhook example could help, yes, maybe a very simple sinatra example in README would be really helpfull!

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 @atipugin atipugin for your code here!

@atipugin
Copy link
Owner

atipugin commented Oct 9, 2015

@Solyaris I agree that webhooks might be a better solution in terms of performance. We definitely need an example of this in docs.

@solyarisoftware
Copy link

yes :-) maybe with http://cuba.is/ microframework for high speed performances, BTW see: http://www.madebymarket.com/blog/dev/ruby-web-benchmark-report.html I'm joking! I'm a Sinatra lover. Asap I'll study me too the point and I'd propose you something, but reading your code, I see you are a step forward. Thanks

@solyarisoftware
Copy link

Hi Alexander!
I'm glad to share with you a possible way to close the "issue" (a feature request indeed):
I just published my project BOTServer: https://github.com/solyaris/BOTServer

Again, I thank you for your help in our mails. If you enjoy my project, I appreciate if you star BOTServer. Viceversa, please let me know your possible criticisms.

Stay in tune
respect
giorgio

@atipugin
Copy link
Owner

Thanks, Giorgio! Added a section about webhooks to README (https://github.com/atipugin/telegram-bot-ruby#webhooks). Now i think we can close the issue.

@solyarisoftware
Copy link

+1

@chriso0710
Copy link

I'd like to refresh this old thread.

I think it might be helpful for people using this gem and wanting to migrate from polling to webhooks, to update the docs and show a minimal webhooks example. Maybe based on Sinatra like #102 does in a PR.

The webhooks technique is important and this gem should acknowledge this. IMHO a simple reference to https://github.com/solyaris/BOTServer might not be the best solution for people who already have a rails or sinatra app running and want to integrate telegram.

Just my 2 cents :-)

Christian

@solyarisoftware
Copy link

Hi Christian,
in facts I wrote BOTServer two years ago;
since then, does something changed in Telegram webhooks management?
In BOTServer I used rack directly for "performance reasons".
I supplied also the sinatra solution.

@chriso0710
Copy link

@Solyaris Yes, I know and I appreciate your work on this. Webhooks are clearly superior compared to polling.
I just wanted to point out, that I think that this gem should offer a simple alternative webhooks approach in the docs/examples for integration into an existing sinatra or rails app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants