1

Add Star

by
Published Jun 6, 2022
Script slack
Other submissions
  • Submitted by rossmccrann Deno
    Created 519 days ago
    1
    import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";
    2
    
    
    3
    type Slack = {
    4
      token: string;
    5
    };
    6
    export async function main(
    7
      slack_auth: Slack,
    8
      channel: string = undefined, // Channel to add star to, or channel where the message to add star to was posted (used with timestamp)
    9
      timestamp: string = undefined, // Timestamp of the message to add star to
    10
      file: string = undefined // File to add star to
    11
    ) {
    12
      const web = new WebClient(slack_auth.token);
    13
    
    
    14
      let response = await web.stars.add({
    15
        channel: channel,
    16
        timestamp: timestamp,
    17
        file: file,
    18
      });
    19
    
    
    20
      return { response: response };
    21
    }
    22
    
    
  • Submitted by hugo989 Bun
    Created 141 days ago
    1
    import { WebClient } from "@slack/web-api";
    2
    
    
    3
    type Slack = {
    4
      token: string;
    5
    };
    6
    export async function main(
    7
      slack_auth: Slack,
    8
      channel: string = undefined, // Channel to add star to, or channel where the message to add star to was posted (used with timestamp)
    9
      timestamp: string = undefined, // Timestamp of the message to add star to
    10
      file: string = undefined // File to add star to
    11
    ) {
    12
      const web = new WebClient(slack_auth.token);
    13
    
    
    14
      let response = await web.stars.add({
    15
        channel: channel,
    16
        timestamp: timestamp,
    17
        file: file,
    18
      });
    19
    
    
    20
      return { response: response };
    21
    }
    22