msg cache per channel

This commit is contained in:
modulatingforce 2025-01-31 13:47:12 -05:00
parent 6b09aeed69
commit 57f1a3c914

View file

@ -344,6 +344,18 @@ impl Bot
&self.message_cache
}
/// get message cache newest to oldest for a channel
pub async fn get_message_cache_per_channel(&self,channel:String) -> Vec<PrivmsgMessage> {
let cache = self.message_cache.lock().await;
let mut rslt = vec![];
for a in cache.iter().rev().filter(|x| { x.channel_login==channel }).into_iter() {
rslt.push(a.clone());
}
rslt
}
}