msg cache per channel
This commit is contained in:
parent
6b09aeed69
commit
57f1a3c914
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue