Add Star  (slack)
One script reply has been approved by the moderators

1 points by danielsoscrap 119 days ago | 41 uses

One script reply has been approved by the moderators
This version of script #22 was approved by the moderators as the one that fits the best the script ask: 'Add Star'. It is safe to use in your flows in production.
0 points
by rossmccrann 103 days ago
edit by rossmccrann 103 days ago
import * as wmill from "https://deno.land/x/[email protected]/index.ts";
import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";

export async function main(
  slack_auth: wmill.Resource<"slack">,
  channel: string = undefined, // Channel to add star to, or channel where the message to add star to was posted (used with timestamp)
  timestamp: string = undefined, // Timestamp of the message to add star to
  file: string = undefined // File to add star to
) {
  const web = new WebClient(slack_auth);

  let response = await web.stars.add({
    channel: channel,
    timestamp: timestamp,
    file: file,
  });

  return { "response": response };
}
edit/run in windmill raw embed