Edits history of script submission #22523 for ' Delete Message (slack)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import { WebClient } from "@slack/web-api";
    /*
    @param: {string} channel - Channel containing the message to be deleted.
    @param: {string} timestamp - Timestamp of the message to be deleted.
    */
    
    type Slack = {
      token: string;
    };
    export async function main(
      slack_auth: Slack,
      channel: string,
      timestamp: string
    ) {
      const web = new WebClient(slack_auth.token);
    
      let response = await web.chat.delete({
        channel: channel,
        ts: timestamp,
      });
    
      return { response: response };
    }
    

    Submitted by hugo989 5 days ago