diff --git a/src/core/botmodules.rs b/src/core/botmodules.rs index a46b479..bbc9f66 100644 --- a/src/core/botmodules.rs +++ b/src/core/botmodules.rs @@ -341,7 +341,7 @@ impl ModulesManager // crate::modules::init(&mut mgr); // let a = a.clone(); // crate::modules::init(a.clone()); - crate::modules::init(Arc::clone(&mgra)); + crate::modules::init(Arc::clone(&mgra)).await; @@ -536,6 +536,7 @@ impl ModulesManager modactions.push(in_action); println!(">> Modules Manager : Called Add bot Action"); + println!("add_botaction - botactions size : {}",modactions.len()); //println!(">> Modules Manager : {:?}",&self); //(); diff --git a/src/modules.rs b/src/modules.rs index 5d533c6..651ea38 100644 --- a/src/modules.rs +++ b/src/modules.rs @@ -27,12 +27,12 @@ mod experiments; // // F : Send, // F : Send + ?Sized, // pub fn init(mgr:&mut ModulesManager) -pub fn init(mgr:Arc) +pub async fn init(mgr:Arc) { // Modules initializer loads modules into the bot // this is achieved by calling submodules that also have fn init() defined - experiments::init(mgr) + experiments::init(mgr).await //(); } \ No newline at end of file diff --git a/src/modules/experiments.rs b/src/modules/experiments.rs index 6548320..f7968c9 100644 --- a/src/modules/experiments.rs +++ b/src/modules/experiments.rs @@ -32,7 +32,7 @@ use std::sync::{Arc, RwLock}; // pub fn init(mgr:&mut ModulesManager) -pub fn init(mgr:Arc) +pub async fn init(mgr:Arc) { @@ -60,7 +60,7 @@ pub fn init(mgr:Arc) ], }; - botc1.add_to_modmgr(Arc::clone(&mgr)); + botc1.add_to_modmgr(Arc::clone(&mgr)).await; @@ -71,7 +71,7 @@ pub fn init(mgr:Arc) help : String::from("") }; - list1.add_to_modmgr(Arc::clone(&mgr)); + list1.add_to_modmgr(Arc::clone(&mgr)).await; }