Start implementing get_relationship

This commit is contained in:
Flori Weber 2023-06-18 14:00:12 +02:00
parent 3bf911745f
commit 94ae449f7d
1 changed files with 13 additions and 0 deletions

View File

@ -37,6 +37,19 @@ impl UserMeta {
.await
}
pub async fn get_relationships(&mut self) -> Result<Vec<types::Relationship>, ChorusLibError> {
let belongs_to = self.belongs_to.borrow();
let url = format!("{}/users/@me/relationships/", belongs_to.urls.get_api(),);
drop(belongs_to);
let request = Client::new().get(url).bearer_auth(self.token());
deserialize_response::<Vec<types::Relationship>>(
request,
self,
crate::api::limits::LimitType::Global,
)
.await
}
/// Sends a friend request to a user.
///
/// # Arguments