Ferris Hook
Discord Webhook API
Usage
Webhook
Cargo.toml
toml
[dependencies]
ferrishook = "1.0.0"
tokio = { version = "1", features = ["full"] }
```rs
extern crate ferrishook;
use ferrishook::webhook::webhook;
[tokio::main]
async fn main() -> Result<(), Box> {
let secret = "webhookkey";
webhook::new(secret, |x|
x.content("<:sus:883136075801956412>")
.username("Rusty WebHook")
.avatarurl("https://avatars.githubusercontent.com/u/74909209?v=4")
.embed(|e| {
e
.title("Imposter")
.description("Kaizer is SUS")
.thumbnail("https://static.wikia.nocookie.net/sexypedia/images/c/ce/Sus.png/revision/latest/scale-to-width-down/440?cb=20210326191942")
.author(|a| {
a.name("sus").iconurl("https://cdn.discordapp.com/emojis/883136075801956412.png?v=1")
})
.color(15258703)
.image("https://c.tenor.com/JYXUxbakjZsAAAAC/amongusflag-us.gif")
.footer(|f| {
f.text("sus")
.iconurl("https://cdn.discordapp.com/emojis/883136075801956412.png?v=1")
})
.addfield("hi", "my", false)
.addfield("hELLO", "ONE", false)
})
)
.send()
.await?;
Ok(())
}
```
Example
sh
cargo run --example markdown
cargo run --example webhook
```rs
use ferrishook::markdown::{codeblock::*, markdown::MarkDown, *};
md::new(|text| {
text.content("println!(\"Hello, World!\");")
.code(|x| x.new(CodeBlockStyle::Code(Some("rust"))))
.bold()
.italic()
})
```
License - GPL-2.0