Edits history of script submission #22526 for ' Add Star (slack)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import { WebClient } from "@slack/web-api";
    
    type Slack = {
      token: string;
    };
    export async function main(
      slack_auth: 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.token);
    
      let response = await web.stars.add({
        channel: channel,
        timestamp: timestamp,
        file: file,
      });
    
      return { response: response };
    }
    

    Submitted by hugo989 6 days ago