Edits history of script submission #293 for ' Send error to slack channel (slack)'

  • deno
    One script reply has been approved by the moderators
    Ap­pro­ved
    import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";
    
    type Slack = {
      token: string;
    };
    export async function main(
      message: string,
      name: string,
      channel: string,
      slack: 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 };
    }
    

    Submitted by hugo697 376 days ago

  • deno
    import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";
    
    type Slack = {
      token: string;
    };
    export async function main(
      message: string,
      name: string,
      channel: string,
      slack: 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 };
    }
    

    Submitted by hugo697 433 days ago

  • deno
    import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";
    
    type Slack = {
      token: string;
    };
    export async function main(
      message: string,
      name: String,
      channel: string,
      slack: 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 };
    }
    

    Submitted by admin 1009 days ago

  • deno
    import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";
    
    type Slack = {
      token: string;
    };
    export async function main(
      message: string,
      name: String,
      channel: string,
      slack: 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 };
    }
    

    Submitted by admin 1012 days ago

  • deno
    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(
      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 };
    }
    

    Submitted by adam186 1140 days ago

  • deno
    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(
      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 };
    }
    

    Submitted by adam186 1175 days ago

  • deno
    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(
      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 };
    }
    

    Submitted by rubenfiszel 1204 days ago