0
Get File
One script reply has been approved by the moderators Verified
Created by armanceraudfarge 892 days ago Viewed 9611 times
0
Submitted by rossmccrann Deno
Verified 878 days ago
1
import { WebClient } from "https://deno.land/x/slack_web_api@1.0.3/mod.ts";
2
/*
3
@param: {string} file - file ID
4
@param: {number} count - Number of items to return per page
5
@param: {numb} page - number of pages to return
6
*/
7

8
type Slack = {
9
  token: string;
10
};
11
export async function main(
12
  slack_auth: Slack,
13
  file: string,
14
  count?: number,
15
  page?: number
16
) {
17
  const web = new WebClient(slack_auth.token);
18

19
  let response = await web.files.info({
20
    file: file,
21
    count: count,
22
    page: page,
23
  });
24

25
  return { response: response };
26
}
27