use revolt_result::Result;
use crate::{AppendMessage, Message, MessageQuery, PartialMessage};
mod mongodb;
mod reference;
#[async_trait]
pub trait AbstractMessages: Sync + Send {
async fn insert_message(&self, message: &Message) -> Result<()>;
async fn fetch_message(&self, id: &str) -> Result<Message>;
async fn fetch_messages(&self, query: MessageQuery) -> Result<Vec<Message>>;
async fn fetch_messages_by_id(&self, ids: &[String]) -> Result<Vec<Message>>;
async fn update_message(&self, id: &str, message: &PartialMessage) -> Result<()>;
async fn append_message(&self, id: &str, append: &AppendMessage) -> Result<()>;
async fn add_reaction(&self, id: &str, emoji: &str, user: &str) -> Result<()>;
async fn remove_reaction(&self, id: &str, emoji: &str, user: &str) -> Result<()>;
async fn clear_reaction(&self, id: &str, emoji: &str) -> Result<()>;
async fn delete_message(&self, id: &str) -> Result<()>;
async fn delete_messages(&self, channel: &str, ids: &[String]) -> Result<()>;
}