-
Notifications
You must be signed in to change notification settings - Fork 218
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
Comments
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. |
Ok, I will do that and provide you with an example that you can include in your README if you want. |
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! |
@Solyaris I agree that webhooks might be a better solution in terms of performance. We definitely need an example of this in docs. |
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 |
Hi Alexander! 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 |
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. |
+1 |
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 |
Hi Christian, |
@Solyaris Yes, I know and I appreciate your work on this. Webhooks are clearly superior compared to polling. |
From the examples, it looks like telegram-bot-ruby supports only the polling method for getting updates. Does it support also the webhook method ?
The text was updated successfully, but these errors were encountered: