bytesnake / telebot

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

pull out resolve_name #51

Closed cirfi closed 6 years ago

cirfi commented 6 years ago

In case I have both new_cmd handler and custom stream middleware.

bot.register(handle);

let stream = bot.get_stream().and_then(|(_, msg)| {
    // do something

    Ok(())
});

bot.resolve_name();

lp.run(stream.for_each(|_| Ok(())).into_future()).unwrap();