dev into main #15
2 changed files with 10 additions and 0 deletions
|
@ -48,6 +48,14 @@ pub struct Chat {
|
|||
impl Chat {
|
||||
|
||||
|
||||
pub fn init(ratelimiters:HashMap<ChType, RateLimiter>,
|
||||
client:TwitchIRCClient<TCPTransport<TLS>, StaticLoginCredentials>) -> Chat {
|
||||
Chat{
|
||||
ratelimiters : ratelimiters,
|
||||
client : client,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn init_channel(&mut self, chnl:ChType) -> () {
|
||||
let n = RateLimiter::new();
|
||||
self.ratelimiters.insert(chnl,n);
|
||||
|
|
|
@ -129,7 +129,9 @@ pub mod bot_actions {
|
|||
use twitch_irc::message::PrivmsgMessage;
|
||||
|
||||
pub type ExecBody = Box<dyn Fn(Chat,PrivmsgMessage) -> Pin<Box<dyn Future<Output=()> + Send>> + Send + Sync>;
|
||||
//pub type ExecBody<F> = Box<dyn Fn(Chat,PrivmsgMessage) -> Pin<Box<dyn Future<Output=F> + Send>> + Send + Sync>;
|
||||
|
||||
//pub fn asyncbox<T,F>(f: fn(Chat,PrivmsgMessage) -> T) -> ExecBody<F>
|
||||
pub fn asyncbox<T>(f: fn(Chat,PrivmsgMessage) -> T) -> ExecBody
|
||||
where
|
||||
T: Future<Output=()> + Send + 'static,
|
||||
|
|
Loading…
Reference in a new issue