use crate::client::MessengerClient;
#[cfg(feature = "cache")]
use crate::client::models::{
Message,
User,
};
#[derive(Clone)]
pub struct Context {
client: MessengerClient,
}
impl Context {
pub fn new(client: MessengerClient) -> Self {
Self { client }
}
pub fn client(&self) -> &MessengerClient {
&self.client
}
#[cfg(feature = "cache")]
pub async fn user(&self) -> Option<User> {
self.client.inner.cache.user()
}
#[cfg(feature = "cache")]
pub async fn messages(&self) -> Vec<Message> {
self.client.inner.cache.messages()
}
}