mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 09:49:07 +01:00
Don't warn abount unhandled updates in repls2
This commit is contained in:
parent
81fbb1769c
commit
1f95c1d2b3
3 changed files with 11 additions and 0 deletions
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Fixed
|
||||
|
||||
- Log `UpdateKind::Error` in `teloxide::dispatching2::Dispatcher`.
|
||||
- Don't warn about unhandled updates in `repls2` ([issue 557](https://github.com/teloxide/teloxide/issues/557)).
|
||||
|
||||
## 0.7.1 - 2022-03-09
|
||||
|
||||
|
|
|
@ -76,10 +76,15 @@ pub async fn commands_repl_with_listener<'a, R, Cmd, H, L, ListenerE, E, Args>(
|
|||
{
|
||||
use crate::dispatching2::Dispatcher;
|
||||
|
||||
// Other update types are of no interest to use since this REPL is only for
|
||||
// commands. See <https://github.com/teloxide/teloxide/issues/557>.
|
||||
let ignore_update = |_upd| Box::pin(async {});
|
||||
|
||||
let mut dispatcher = Dispatcher::builder(
|
||||
bot,
|
||||
Update::filter_message().filter_command::<Cmd>().branch(dptree::endpoint(handler)),
|
||||
)
|
||||
.default_handler(ignore_update)
|
||||
.build();
|
||||
|
||||
#[cfg(feature = "ctrlc_handler")]
|
||||
|
|
|
@ -56,9 +56,14 @@ where
|
|||
{
|
||||
use crate::dispatching2::Dispatcher;
|
||||
|
||||
// Other update types are of no interest to use since this REPL is only for
|
||||
// messages. See <https://github.com/teloxide/teloxide/issues/557>.
|
||||
let ignore_update = |_upd| Box::pin(async {});
|
||||
|
||||
#[allow(unused_mut)]
|
||||
let mut dispatcher =
|
||||
Dispatcher::builder(bot, Update::filter_message().branch(dptree::endpoint(handler)))
|
||||
.default_handler(ignore_update)
|
||||
.build();
|
||||
|
||||
#[cfg(feature = "ctrlc_handler")]
|
||||
|
|
Loading…
Reference in a new issue