Magic ball added.

Signed-off-by: Pavel Kirilin <win10@list.ru>
This commit is contained in:
2023-02-25 03:39:25 +04:00
parent 27906a1684
commit 940f7a18ef
3 changed files with 65 additions and 1 deletions

View File

@ -22,7 +22,10 @@ use super::{
help::Help,
weather_forecaster::WeatherForecaster,
},
fun::{blyaficator::Blyaficator, greeter::Greeter, repeator::Repeator, rotator::Rotator},
fun::{
blyaficator::Blyaficator, greeter::Greeter, magic_ball::MagicBall, repeator::Repeator,
rotator::Rotator,
},
Handler,
},
middlewares::members_count::MembersCount,
@ -139,6 +142,11 @@ async fn run(args: BotConfig, client: Client) -> anyhow::Result<()> {
.add_filter(ExcludedChatsFilter(vec![me.id()]))
.add_filter(RegexFilter(Regex::new("^[)0]+$")?))
.add_middleware::<MembersCount<100>>(),
// The magic balls.
FilteredHandler::new(MagicBall)
.add_filter(UpdateTypeFilter(&[UpdateType::New]))
.add_filter(SilentFilter)
.add_filter(TextFilter(&[".mb"], TextMatchMethod::IStartsWith)),
];
let mut errors_count = 0;