1use ferrishook::*;
2
3#[tokio::main]
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}