Edits history of script submission #181 for ' Example of responding to Slack commands and @mentions (slack)'

  • deno
    export async function main(
      response_url: string,
      text: string,
    ) {
      const x = await fetch(response_url, {
        method: 'POST',
        body: JSON.stringify({ text: `ROGER ${text}` }),
      });
    }

    Submitted by admin 1277 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(
      response_url: string,
      text: string,
    ) {
      const tokenResource = await wmill.getResource("u/user/my_slack");
    
      await fetch(response_url, {
        method: 'POST',
        body: JSON.stringify({ response_url, text: `ROGER ${text}` }),
        headers: { "Authorization": `Bearer ${tokenResource.token}` },
      });
      return;
    }
    

    Submitted by admin 1277 days ago