discord_webhook2/message/embed/
footer.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Serialize, Deserialize, Debug, Clone)]
4pub struct EmbedFooter {
5    pub text: String,
6    #[serde(rename = "icon_url")]
7    pub url_icon: Option<String>,
8    #[serde(rename = "proxy_icon_url")]
9    pub url_icon_proxy: Option<String>,
10}
11
12impl EmbedFooter {
13    pub fn new() -> Self {
14        Self {
15            text: String::new(),
16            url_icon: None,
17            url_icon_proxy: None,
18        }
19    }
20
21    pub fn text(mut self, text: impl Into<String>) -> Self {
22        self.text = text.into();
23        self
24    }
25
26    pub fn url_icon(mut self, url_icon: impl Into<String>) -> Self {
27        self.url_icon = Some(url_icon.into());
28        self
29    }
30
31    pub fn url_icon_proxy(mut self, url_icon_proxy: impl Into<String>) -> Self {
32        self.url_icon_proxy = Some(url_icon_proxy.into());
33        self
34    }
35}
36
37impl Default for EmbedFooter {
38    fn default() -> Self {
39        Self::new()
40    }
41}