0

Get File

by
Published Jun 6, 2022
Script slack Verified

The script

Submitted by hugo989 Bun
Verified 6 days ago
1
import { WebClient } from "@slack/web-api";
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

Other submissions
  • Submitted by rossmccrann Deno
    Created 384 days ago
    1
    import { WebClient } from "https://deno.land/x/[email protected]/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