diff --git a/src/core/botinstance.rs b/src/core/botinstance.rs index 0f1ce9a..ae59b74 100644 --- a/src/core/botinstance.rs +++ b/src/core/botinstance.rs @@ -407,9 +407,10 @@ impl BotInstance for (_m,acts) in &self.botmodules.botactions { for a in acts { - if let crate::core::botmodules::BotAction::L(lsnr) = a { - lsnr.execute(self.chat.clone(),msg.clone()).await; - } + // if let crate::core::botmodules::BotAction::L(lsnr) = a { + // lsnr.execute(self.chat.clone(),msg.clone()).await; + // } + a.execute(self.chat.clone(), msg.clone()).await; } }; diff --git a/src/core/botmodules.rs b/src/core/botmodules.rs index e2f0647..3053f1c 100644 --- a/src/core/botmodules.rs +++ b/src/core/botmodules.rs @@ -74,6 +74,18 @@ pub enum BotAction R(Routine), } +impl BotAction { + pub async fn execute(&self,m:botinstance::Chat,n:PrivmsgMessage){ + + match self { + BotAction::L(a) => a.execute(m,n).await, + _ => (), + } + // (self.exec_body)(m,n).await; + + } +} + // pub trait BotActionTrait // where