Edits history of script submission #23264 for ' Delete File (slack)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import { WebClient } from "@slack/web-api"
    
    /**
     * Delete File
     * Delete a file by ID. A bot token can delete only files it uploaded; a user token deletes the user's own files (admins: any). Needs files:write (bot default; tick it for a user token).
     */
    export async function main(auth: RT.Slack, file: string) {
      const client = new WebClient(auth.token)
      return await client.files.delete({ file })
    }
    

    Submitted by hugo989 2 hours ago