mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-25 01:25:12 +01:00
Fix one error
This commit is contained in:
parent
117094e9d0
commit
51b52b8317
1 changed files with 10 additions and 10 deletions
|
@ -142,7 +142,7 @@ where
|
||||||
let mut allowed_updates = Some(allowed_updates.into());
|
let mut allowed_updates = Some(allowed_updates.into());
|
||||||
|
|
||||||
stream::unfold((bot, 0), move |(bot, mut offset)| async move {
|
stream::unfold((bot, 0), move |(bot, mut offset)| async move {
|
||||||
let updates = bot
|
let updates = match bot
|
||||||
.get_updates()
|
.get_updates()
|
||||||
.offset(offset)
|
.offset(offset)
|
||||||
.timeout(timeout.as_secs().try_into().expect("timeout is too big"))
|
.timeout(timeout.as_secs().try_into().expect("timeout is too big"))
|
||||||
|
@ -150,15 +150,15 @@ where
|
||||||
.allowed_updates(allowed_updates.take().unwrap_or(&[]))
|
.allowed_updates(allowed_updates.take().unwrap_or(&[]))
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
.map_or_else(
|
{
|
||||||
|err| vec![Err(err)],
|
Err(err) => vec![Err(err)],
|
||||||
|updates| {
|
Ok(updates) => {
|
||||||
if let Some(upd) = updates.last() {
|
if let Some(upd) = updates.last() {
|
||||||
offset = upd.id + 1;
|
offset = upd.id + 1;
|
||||||
}
|
}
|
||||||
updates.into_iter().map(Ok).collect::<Vec<_>>()
|
updates.into_iter().map(Ok).collect::<Vec<_>>()
|
||||||
},
|
}
|
||||||
);
|
};
|
||||||
|
|
||||||
Some((stream::iter(updates), (bot, offset)))
|
Some((stream::iter(updates), (bot, offset)))
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue