use crate::Error;
use adiscord_types::api::emojis::Emoji;
use reqwest::StatusCode;
impl crate::Emoji {
pub async fn gets(&self, index: &str) -> Result<Vec<Emoji>, Error> {
let response = self
.client
.get(format!("{}/guilds/{index}/emojis", self.url))
.send()
.await
.unwrap();
let status = response.status();
match status {
StatusCode::OK => {
let body: Vec<Emoji> = response.json().await.unwrap();
Ok(body)
}
_ => {
let body: Error = response.json().await.unwrap();
Err(body)
}
}
}
}