pub struct WebHookEmbedFooter {
pub text: Option<String>,
pub icon_url: Option<String>,
}
Fields§
§text: Option<String>
§icon_url: Option<String>
Implementations§
pub fn new() -> WebHookEmbedFooter
Sourcepub fn text<T: AsRef<str>>(self, text: T) -> WebHookEmbedFooter
pub fn text<T: AsRef<str>>(self, text: T) -> WebHookEmbedFooter
Examples found in repository?
examples/webhook.rs (line 20)
4async fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let secret = "webhook_key";
6 webhook::new(secret, |x| {
7 x.content("Hello, World!")
8 .username("Rusty WebHook")
9 .avatar_url("https://avatars.githubusercontent.com/u/74909209")
10 .embed(|e| {
11 e.title("Embed Title")
12 .description("Embed Description")
13 .thumbnail("https://avatars.githubusercontent.com/u/5430905")
14 .author(|a| {
15 a.name("Author Name")
16 .icon_url("https://avatars.githubusercontent.com/u/9919")
17 })
18 .color(15258703)
19 .image("https://i.imgur.com/nBeX2Y3.jpg")
20 .footer(|f| f.text("Footer").icon_url("https://i.imgur.com/vk1RYK4.png"))
21 .add_field("Field 1", "Value 1", false)
22 .add_field("Field 2", "Value 2", false)
23 })
24 })
25 .send()
26 .await?;
27
28 Ok(())
29}
Sourcepub fn icon_url<T: AsRef<str>>(self, icon_url: T) -> WebHookEmbedFooter
pub fn icon_url<T: AsRef<str>>(self, icon_url: T) -> WebHookEmbedFooter
Examples found in repository?
examples/webhook.rs (line 20)
4async fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let secret = "webhook_key";
6 webhook::new(secret, |x| {
7 x.content("Hello, World!")
8 .username("Rusty WebHook")
9 .avatar_url("https://avatars.githubusercontent.com/u/74909209")
10 .embed(|e| {
11 e.title("Embed Title")
12 .description("Embed Description")
13 .thumbnail("https://avatars.githubusercontent.com/u/5430905")
14 .author(|a| {
15 a.name("Author Name")
16 .icon_url("https://avatars.githubusercontent.com/u/9919")
17 })
18 .color(15258703)
19 .image("https://i.imgur.com/nBeX2Y3.jpg")
20 .footer(|f| f.text("Footer").icon_url("https://i.imgur.com/vk1RYK4.png"))
21 .add_field("Field 1", "Value 1", false)
22 .add_field("Field 2", "Value 2", false)
23 })
24 })
25 .send()
26 .await?;
27
28 Ok(())
29}
Trait Implementations§
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more