Add reactions: get
This commit is contained in:
parent
fab9bc1c62
commit
4f91f26a28
|
@ -34,4 +34,29 @@ impl ReactionMeta {
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn get(
|
||||||
|
&self,
|
||||||
|
emoji: &str,
|
||||||
|
user: &mut UserMeta,
|
||||||
|
) -> Result<reqwest::Response, crate::errors::InstanceServerError> {
|
||||||
|
let mut belongs_to = user.belongs_to.borrow_mut();
|
||||||
|
let url = format!(
|
||||||
|
"{}/channels/{}/messages/{}/reactions/{}/",
|
||||||
|
belongs_to.urls.get_api(),
|
||||||
|
self.channel_id,
|
||||||
|
self.message_id,
|
||||||
|
emoji
|
||||||
|
);
|
||||||
|
let request = Client::new().get(url).bearer_auth(user.token());
|
||||||
|
LimitedRequester::new()
|
||||||
|
.await
|
||||||
|
.send_request(
|
||||||
|
request,
|
||||||
|
crate::api::limits::LimitType::Channel,
|
||||||
|
&mut belongs_to.limits,
|
||||||
|
&mut user.limits,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue