2 releases

0.1.1 Sep 16, 2021
0.1.0 Mar 12, 2021

#40 in #slack

Download history 45/week @ 2024-11-13 46/week @ 2024-11-20 51/week @ 2024-11-27 48/week @ 2024-12-04 71/week @ 2024-12-11 13/week @ 2024-12-18 13/week @ 2025-01-01 105/week @ 2025-01-08 78/week @ 2025-01-15 45/week @ 2025-01-22 84/week @ 2025-01-29 116/week @ 2025-02-05 48/week @ 2025-02-12 62/week @ 2025-02-19 43/week @ 2025-02-26

290 downloads per month
Used in rss-forwarder

MIT license

18KB
440 lines

slack-bk Build Status Docs Latest Version

Rust crate for Slack's BlockKit API

You'll probably want to reference Slack's documentation while using this crate.

Using slack-bk with an HTTP client

slack-bk does not come with a built in mechanism to talk to slack's API. There are many popular HTTP libraries in the rust ecosystem and the user is free to choose their own.

use reqwest::{Client, Error};
use slack_bk::surfaces::Message;

async fn send_to_webhook(webhook: &str, client: &Client, msg: Message) -> Result<(), Error> {
    client
        .post(webhook)
        .json(&msg)
        .send()
        .await?
        .error_for_status()?
        .map(|_| ())

}

Dependencies

~0.3–0.9MB
~20K SLoC