rive_http/users/
direct_messaging.rs1use crate::prelude::*;
2use rive_models::channel::Channel;
3
4impl Client {
5 pub async fn fetch_direct_message_channels(&self) -> Result<Vec<Channel>> {
7 Ok(self
8 .client
9 .get(ep!(self, "/users/dms"))
10 .auth(&self.authentication)
11 .send()
12 .await?
13 .process_error()
14 .await?
15 .json()
16 .await?)
17 }
18
19 pub async fn open_direct_message(&self, id: impl Into<String>) -> Result<Channel> {
23 Ok(self
24 .client
25 .get(ep!(self, "/users/{}/dm", id.into()))
26 .auth(&self.authentication)
27 .send()
28 .await?
29 .process_error()
30 .await?
31 .json()
32 .await?)
33 }
34}