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
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/// Represents a Message Embed being sent.
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct Embed {
    /// The title of the embed.
    #[serde(default)]
    pub title: String,
    /// The type of embed.
    #[serde(default, rename = "type")]
    pub kind: String,
    /// The description of the embed.
    #[serde(default)]
    pub description: String,
    /// The URL of the embed.
    #[serde(default)]
    pub url: String,
    /// The timestamp of the embed.
    #[serde(default)]
    pub timestamp: String,
    /// The color of the embed.
    #[serde(default)]
    pub color: i32,
    /// Information about the embed's footer.
    #[serde(default)]
    pub footer: EmbedFooter,
    /// Information about the embed's image.
    #[serde(default)]
    pub image: EmbedImage,
    /// Information about the embed's thumbnail.
    #[serde(default)]
    pub thumbnail: EmbedThumbnail,
    /// Information about an embed's video, if applicable.
    #[serde(default)]
    pub video: EmbedVideo,
    /// Information about an embed's provider if applicable.
    #[serde(default)]
    pub provider: EmbedProvider,
    /// Information about the embed's author.
    #[serde(default)]
    pub author: EmbedAuthor,
    /// Information about the embed's fields.
    pub fields: EmbedField
}

/// An Embed Footer data object.
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct EmbedFooter {
    /// The text of this footer.
    pub text: String,
    /// The Icon URL of this footer.
    #[serde(default)]
    pub icon_url: String,
    /// The proxied URL of the icon.
    #[serde(default)]
    pub proxy_icon_url: String

}

/// An Embed Image data object.
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct EmbedImage {
    /// The source URL of the image.
    #[serde(default)]
    pub url: String,
    /// A proxied URL of the image.
    #[serde(default)]
    pub proxy_url: String,
    /// The height of the image.
    #[serde(default)]
    pub height: i32,
    /// The width of the image.
    #[serde(default)]
    pub width: i32
}

/// An Embed Thumbnail data object.
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct EmbedThumbnail {
    /// The source URL of the thumbnail.
    #[serde(default)]
    pub url: String,
    #[serde(default)]
    /// A proxied URL of the thumbnail.
    pub proxy_url: String,
    /// The height of the thumbnail.
    #[serde(default)]
    pub height: i32,
    /// The width of the thumbnail.
    #[serde(default)]
    pub width: i32
}

/// An Embed Video data object.
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct EmbedVideo {
    /// The source URL of the video.
    #[serde(default)]
    pub url: String,
    /// The height of the video.
    #[serde(default)]
    pub height: i32,
    /// The width of the thumbnail.
    #[serde(default)]
    pub width: i32
}

/// Information about the embed's provider.
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct EmbedProvider {
    /// The name of the provider.
    #[serde(default)]
    pub name: String,
    /// The url of the provider.
    #[serde(default)]
    pub url: String
}

/// Information about the embed's author.
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct EmbedAuthor {
    /// The name of the author.
    #[serde(default)]
    pub name: String,
    /// The URL of the author.
    #[serde(default)]
    pub url: String,
    /// The URL of the author's icon.
    #[serde(default)]
    pub icon_url: String,
    /// A proxied version of the author's icon.
    #[serde(default)]
    pub proxy_icon_url: String
}

/// Represents an Embed Field object.
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct EmbedField {
    /// The name of the field.
    pub name: String,
    /// The value of the field.
    pub value: String,
    /// Whether or not this field should display as inline.
    #[serde(default)]
    pub inline: bool
}