diff --git a/src/core/botinstance.rs b/src/core/botinstance.rs index 80bfb06..6b3903f 100644 --- a/src/core/botinstance.rs +++ b/src/core/botinstance.rs @@ -48,6 +48,14 @@ pub struct Chat { impl Chat { + pub fn init(ratelimiters:HashMap, + client:TwitchIRCClient, StaticLoginCredentials>) -> Chat { + Chat{ + ratelimiters : ratelimiters, + client : client, + } + } + pub fn init_channel(&mut self, chnl:ChType) -> () { let n = RateLimiter::new(); self.ratelimiters.insert(chnl,n); diff --git a/src/core/botmodules.rs b/src/core/botmodules.rs index 4035a35..bdaba67 100644 --- a/src/core/botmodules.rs +++ b/src/core/botmodules.rs @@ -129,7 +129,9 @@ pub mod bot_actions { use twitch_irc::message::PrivmsgMessage; pub type ExecBody = Box Pin + Send>> + Send + Sync>; + //pub type ExecBody = Box Pin + Send>> + Send + Sync>; + //pub fn asyncbox(f: fn(Chat,PrivmsgMessage) -> T) -> ExecBody pub fn asyncbox(f: fn(Chat,PrivmsgMessage) -> T) -> ExecBody where T: Future + Send + 'static,