slack-flows 0.1.19

Slack extension for flows.network
Documentation

This is a library for integrating Slack in your flow function for test.flows.network.

Example usage

use slack_flows::{
    listen_to_channel, message_from_channel, revoke_listeners, send_message_to_channel,
};

#[no_mangle]
pub fn register() {
    revoke_listeners();
    listen_to_channel("myworkspace", "mychannel") {
}

#[no_mangle]
pub fn work() {
    if let Some(sm) = message_from_channel() {
        send_message_to_channel("myworkspace", "mychannel", format!("Hello, {}", sm.text));
    }
}

In register() the listen_to_channel will create a listener for new message from channel mychannel in workspace myworkspace.

When a new message is sent to mychannel, the work() will be called. We get the SlackMessage using message_from_channel then send_message_to_channel.

The whole document is here.