diff --git a/src/bot_handler.rs b/src/bot_handler.rs index a96af0e..c5998c4 100644 --- a/src/bot_handler.rs +++ b/src/bot_handler.rs @@ -87,6 +87,16 @@ async fn handle_botmessage(bot: Bot, mut db: DB, bm: BotMessage, msg: Message) - None }; + // Filtering to use only defined variants + let variant = match bm + .variants() + .iter() + .any(|v| v == variant.as_ref().map_or("", |v| v)) + { + true => variant, + false => None, + }; + let is_propagate: bool = match bm.get_handler() { Some(handler) => 'prop: { let ctx = match handler.context() {