Merge pull request #182 from teloxide/fix-polling-default

Fix polling_default
This commit is contained in:
Temirkhan Myrzamadi 2020-02-25 14:33:32 +06:00 committed by GitHub
commit 578783e33e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,11 +116,11 @@ pub trait UpdateListener<E>: Stream<Item = Result<Update, E>> {
} }
impl<S, E> UpdateListener<E> for S where S: Stream<Item = Result<Update, E>> {} impl<S, E> UpdateListener<E> for S where S: Stream<Item = Result<Update, E>> {}
/// Returns a long polling update listener with the default configuration. /// Returns a long polling update listener with `timeout` of 1 minute.
/// ///
/// See also: [`polling`](polling). /// See also: [`polling`](polling).
pub fn polling_default(bot: Arc<Bot>) -> impl UpdateListener<RequestError> { pub fn polling_default(bot: Arc<Bot>) -> impl UpdateListener<RequestError> {
polling(bot, None, None, None) polling(bot, Some(Duration::from_secs(60)), None, None)
} }
/// Returns a long/short polling update listener with some additional options. /// Returns a long/short polling update listener with some additional options.