Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

mixtape-oss/webhook-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webhook

Crates License

Use

To use this crate add this to your Cargo.toml

webhook = "1.0.0"

Example

use webhook::Webhook;
use std::error::Error;

#[tokio::main]
fn main() -> Result<(), Box<dyn Error>> {
    let webhook = Webhook::from_url("{WEBHOOK URL}");
    webhook.send(|message| message. {
        content("Message")
        .tts(true)
        .username("{USERNAME}")
        .avatar_url("{AVATAR_URL}")
        .embed(|embed| embed. // You can have up to 10 embeds
            title("{TITLE}")
            .color({COLOR}) // Example: 0x32a852
            .field("{FIELD}", "{VALUE}", {INLINE} (bool)) // You can add multiple fields
            .field("{FIELD}", "{VALUE}", {INLINE} (bool))
            .video("{URL}", None, None)
            .image("{URL}", {HEIGHT}, {WIDTH})
            .author("{NAME}", "{URL}", "{ICON_URL}", None)
            .footer("{NAME}", "{ICON_URl}")
        )
    }).await?;
    Ok(())
}

About

Discord Webhook API Wrapper for Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%