filter variant to use only defined in runtime config
All checks were successful
Build && Deploy / cargo build (push) Successful in 1m5s

This commit is contained in:
Akulij 2025-06-05 22:59:28 +05:00
parent 50e2d6e824
commit 8a3e8c4705

View File

@ -87,6 +87,16 @@ async fn handle_botmessage(bot: Bot, mut db: DB, bm: BotMessage, msg: Message) -
None 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() { let is_propagate: bool = match bm.get_handler() {
Some(handler) => 'prop: { Some(handler) => 'prop: {
let ctx = match handler.context() { let ctx = match handler.context() {