Search... Ctrl + K

Get File (slack)
One script reply has been approved by the moderators Verified

Created by armanceraudfarge 187 days ago Used 88 times 0 Points

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import * as wmill from "https://deno.land/x/windmill@v1.12.0/index.ts";
import { WebClient } from "https://deno.land/x/slack_web_api@1.0.3/mod.ts";
/*
@param: {string} file - file ID
@param: {number} count - Number of items to return per page
@param: {numb} page - number of pages to return
*/

export async function main(
  slack_auth: wmill.Resource<"slack">,
  file: string,
  count?: number,
  page?: number,
) {
  const web = new WebClient(slack_auth);

  let response = await web.files.info({
    file: file,
    count: count,
    page: page,
  });

  return { "response": response };
}

Submitted by rossmccrann 173 days ago

Edited 172 days ago

  • 0
    Why does this need "count" and "page" when the goal is to get a file by its file ID?
    by jaller94 70 days ago