mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Fix todo: use get_updates
in polling
This commit is contained in:
parent
4f77f8f371
commit
e673335e1f
1 changed files with 1 additions and 6 deletions
|
@ -138,12 +138,7 @@ where
|
|||
pub fn polling<'a>(bot: &'a Bot) -> impl Updater<Error = RequestError> + 'a {
|
||||
let stream = stream::unfold((bot, 0), |(bot, mut offset)| {
|
||||
async move {
|
||||
// this match converts Result<Vec<_>, _> -> Vec<Result<_, _>>
|
||||
// TODO: for now `get_updates` are removed, but when we implement it
|
||||
// back, we need to fix this code.
|
||||
// See https://github.com/telebofr/telebofr/issues/81.
|
||||
let updates: Result<Vec<Update>, RequestError> = todo!();
|
||||
let updates = match /* bot.get_updates().offset(offset).send().await */ updates {
|
||||
let updates = match bot.get_updates().offset(offset).send().await {
|
||||
Ok(updates) => {
|
||||
if let Some(upd) = updates.last() {
|
||||
offset = upd.id + 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue