mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-05 10:24:32 +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
|
### Fixed
|
||||||
|
|
||||||
- Log `UpdateKind::Error` in `teloxide::dispatching2::Dispatcher`.
|
- 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
|
## 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;
|
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(
|
let mut dispatcher = Dispatcher::builder(
|
||||||
bot,
|
bot,
|
||||||
Update::filter_message().filter_command::<Cmd>().branch(dptree::endpoint(handler)),
|
Update::filter_message().filter_command::<Cmd>().branch(dptree::endpoint(handler)),
|
||||||
)
|
)
|
||||||
|
.default_handler(ignore_update)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
#[cfg(feature = "ctrlc_handler")]
|
#[cfg(feature = "ctrlc_handler")]
|
||||||
|
|
|
@ -56,9 +56,14 @@ where
|
||||||
{
|
{
|
||||||
use crate::dispatching2::Dispatcher;
|
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)]
|
#[allow(unused_mut)]
|
||||||
let mut dispatcher =
|
let mut dispatcher =
|
||||||
Dispatcher::builder(bot, Update::filter_message().branch(dptree::endpoint(handler)))
|
Dispatcher::builder(bot, Update::filter_message().branch(dptree::endpoint(handler)))
|
||||||
|
.default_handler(ignore_update)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
#[cfg(feature = "ctrlc_handler")]
|
#[cfg(feature = "ctrlc_handler")]
|
||||||
|
|
Loading…
Reference in a new issue