Crate slack_flows

source ·
Expand description

Slack integration for Flows.network

Quick Start

To get started, the easist way is to write a flow function that acts as a Hello World Slack bot.

use slack_flows::{listen_to_channel, send_message_to_channel};

#[no_mangle]
pub fn run() {
    listen_to_channel("myworkspace", "mychannel", |sm| {
        send_message_to_channel("myworkspace", "mychannel", format!("Hello, {}",
        sm.text))
    }).await;
}

listen_to_channel() is responsible for registering a listener for channel mychannel of workspace myworkspace. Whenever a new message is sent to the channel, the callback closure is called with received message then send_message_to_channel() is used to send a response message to the same channel.

Structs

Functions