2 releases

0.1.1 Sep 16, 2021
0.1.0 Mar 12, 2021

#1776 in Web programming

Download history 20/week @ 2024-01-04 48/week @ 2024-01-11 82/week @ 2024-01-18 68/week @ 2024-01-25 72/week @ 2024-02-01 36/week @ 2024-02-08 66/week @ 2024-02-15 66/week @ 2024-02-22 50/week @ 2024-02-29 82/week @ 2024-03-07 47/week @ 2024-03-14 42/week @ 2024-03-21 58/week @ 2024-03-28 46/week @ 2024-04-04 78/week @ 2024-04-11 81/week @ 2024-04-18

268 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.4–1MB
~23K SLoC