1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use serde::{Deserialize, Serialize};
use crate::types::{Snowflake, User};
/// An emoji as used on buttons, select options and reactions: a unicode emoji (`name` only) or a
/// custom one (`id`, `name`, `animated`). In `rsx!` markup, `emoji="👍"`.
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct PartialEmoji {
/// [emoji id](https://discord.com/developers/docs/reference#image-formatting)
pub id: Option<Snowflake>,
/// emoji name
pub name: Option<String>,
/// whether this emoji is animated
pub animated: Option<bool>,
}
/// [Emoji Object](https://discord.com/developers/docs/resources/emoji#emoji-object)
#[derive(Debug, Clone, Deserialize)]
pub struct Emoji {
/// [emoji id](https://discord.com/developers/docs/reference#image-formatting)
pub id: Option<Snowflake>,
/// emoji name
pub name: Option<String>,
/// ids of the roles allowed to use this emoji
pub roles: Option<Vec<Snowflake>>,
/// user that created this emoji
pub user: Option<User>,
/// whether this emoji must be wrapped in colons
pub require_colons: Option<bool>,
/// whether this emoji is managed
pub managed: Option<bool>,
/// whether this emoji is animated
pub animated: Option<bool>,
/// whether this emoji can be used, may be false due to loss of Server Boosts
pub available: Option<bool>,
}
impl PartialEq for Emoji {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}