slack
Implementation of the Slack Web API. There is no default interpreter because this plugin requires a bot token.
The playground uses mocked API responses so message and channel operations are deterministic.
import { slack, wrapSlackWebClient, createSlackInterpreter } from "@mvfm/plugin-slack";
import { WebClient } from "@slack/web-api";
// 1. Create a Slack Web API client
const webClient = new WebClient(process.env.SLACK_BOT_TOKEN);
const client = wrapSlackWebClient(webClient);
// 2. Build the interpreter
const slackInterp = createSlackInterpreter(client);
// 3. Merge and run
const app = mvfm(prelude, slack);
const baseInterp = defaults(app, { slack: slackInterp });
await fold(baseInterp, prog);