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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
use serde::{Deserialize, Serialize};
use crate::models::payloads::user::APIUser;
/**
* Types extracted from https://discord.com/developers/docs/resources/emoji
*/
/**
* Not documented but mentioned
*/
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct APIPartialEmoji {
/**
* Emoji id
*/
pub id: Option<String>,
/**
* Emoji name (can be null only in reaction emoji objects)
*/
pub name: Option<String>,
/**
* Whether this emoji is animated
*/
pub animated: Option<bool>,
}
/**
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure}
*/
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct APIEmoji {
/**
* Roles this emoji is whitelisted to
*/
pub roles: Option<Vec<String>>,
/**
* User that created this emoji
*/
pub user: Option<APIUser>,
/**
* 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 can be used, may be false due to loss of Server Boosts
*/
pub available: Option<bool>,
#[serde(flatten)]
pub base: APIPartialEmoji,
}
/**
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object-applicationowned-emoji}
*/
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct APIApplicationEmoji {
/**
* Roles allowed to use this emoji.
*
* @remarks Always empty.
*/
pub roles: Vec<String>,
/**
* Whether this emoji must be wrapped in colons.
*
* @remarks Always `true`.
*/
pub require_colons: bool,
/**
* Whether this emoji is managed.
*
* @remarks Always `false`.
*/
pub managed: bool,
/**
* Whether this emoji is available.
*
* @remarks Always `true`.
*/
pub available: bool,
#[serde(flatten)]
pub base: APIApplicationEmojiRequiredFields,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct APIApplicationEmojiRequiredFields {
pub animated: bool,
pub id: String,
pub name: String,
pub user: APIUser,
}