use crate::prelude::*;
use rive_models::channel::Channel;
impl Client {
pub async fn fetch_direct_message_channels(&self) -> Result<Vec<Channel>> {
Ok(self
.client
.get(ep!(self, "/users/dms"))
.auth(&self.authentication)
.send()
.await?
.process_error()
.await?
.json()
.await?)
}
pub async fn open_direct_message(&self, id: impl Into<String>) -> Result<Channel> {
Ok(self
.client
.get(ep!(self, "/users/{}/dm", id.into()))
.auth(&self.authentication)
.send()
.await?
.process_error()
.await?
.json()
.await?)
}
}