bytesnake / telebot

Write Telegram bots in Rust with Tokio and Futures
Other
212 stars 33 forks source link

Webhook support #20

Open bemyak opened 6 years ago

bemyak commented 6 years ago

It would be very nice if telebot had support of webhooks. If you're writing telegram bot on Rust than you probably expect extreamly high performance and "pull" method is something opposite to it :)

tecywiz121 commented 6 years ago

The pull method is supposed to be long polling, so the performance shouldn't be that terrible.

That said, if you want to scale beyond a single process polling, I suspect the webhooks method is probably the way to go.

bytesnake commented 6 years ago

The library did not used long polling up to this point, but I added support in 6a632d72afd6d3a4a97f9ec5c61781e7f838c4b4 and telebot will now wait 30s before it sends a new request. Nevertheless it would be nice to support webhooks. But first we need to switch the underlying infrastructure from cURL to hyper to have server support and then extend the Bot struct to host a server. #21

bytesnake commented 6 years ago

This is blocked until a library for multiform server AND client support is published. The best candidate ist https://github.com/abonander/multipart-async, but it has no client support yet.