Added Chooser handler.

Signed-off-by: Pavel Kirilin <win10@list.ru>
This commit is contained in:
2023-02-26 05:49:59 +04:00
parent 99c049549f
commit 9dbd32cc5b
3 changed files with 42 additions and 2 deletions

View File

@ -23,8 +23,8 @@ use super::{
weather_forecaster::WeatherForecaster,
},
fun::{
blyaficator::Blyaficator, greeter::Greeter, magic_ball::MagicBall, repeator::Repeator,
rotator::Rotator,
blyaficator::Blyaficator, chooser::Chooser, greeter::Greeter, magic_ball::MagicBall,
repeator::Repeator, rotator::Rotator,
},
Handler,
},
@ -147,6 +147,11 @@ async fn run(args: BotConfig, client: Client) -> anyhow::Result<()> {
.add_filter(UpdateTypeFilter(&[UpdateType::New]))
.add_filter(SilentFilter)
.add_filter(TextFilter(&[".mb"], TextMatchMethod::IStartsWith)),
// Random chooser.
FilteredHandler::new(Chooser)
.add_filter(UpdateTypeFilter(&[UpdateType::New]))
.add_filter(SilentFilter)
.add_filter(TextFilter(&[".c"], TextMatchMethod::IStartsWith)),
];
let mut errors_count = 0;