Send Message to Channel  (slack)
One script reply has been approved by the moderators

0 points by admin 67 days ago | 7530 uses

slack

One script reply has been approved by the moderators
This version of script #72 was approved by the moderators as the one that fits the best the script ask: 'Send Message to Channel'. It is safe to use in your flows in production.
0 points
by admin 67 days ago
edit by admin 67 days ago
import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";
import type { Resource } from "https://deno.land/x/[email protected]/mod.ts";

export async function main(
  text: string,
  channel: string,
  slack: Resource<"slack">,
) {
  const web = new WebClient(slack.token);

  await web.chat.postMessage({
    channel,
    text,
  });
}
edit/run in windmill raw embed