dev into main #15

Merged
modulatingforce merged 40 commits from dev into main 2024-02-25 11:31:11 -05:00
2 changed files with 10 additions and 0 deletions
Showing only changes of commit a556a5aa89 - Show all commits

View file

@ -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);

View file

@ -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,