Created by rubenfiszel 56 days ago Viewed 7555 times 0 Points
No comments yet
import { WebClient } from "https://deno.land/x/slack_web_api@1.0.0/mod.ts";
import type { Resource } from "https://deno.land/x/windmill@v1.70.1/mod.ts";
export async function main(
message: string,
name: String,
channel: string,
slack: Resource<"slack">,
) {
const web = new WebClient(slack.token);
const flow_id = Deno.env.get("WM_FLOW_JOB_ID");
const text = message = `Flow [${flow_id}](${
Deno.env.get("WM_BASE_URL")
}/run/${flow_id}?workspace=${
Deno.env.get("WM_WORKSPACE")
}) had an error:\n${name}: ${message}`;
await web.chat.postMessage({
channel,
text,
});
return { message, flow_id };
}
No comments yet