1

List Conversation History

by
Published Jun 20, 2022
Script slack Verified

The script

Submitted by hugo989 Bun
Verified 10 days ago
1
import { WebClient } from "@slack/web-api";
2
/*
3
@param: {string} channel - Conversation ID to fetch history for.
4
*/
5

6
type Slack = {
7
  token: string;
8
};
9
export async function main(slack_auth: Slack, channel: string) {
10
  const web = new WebClient(slack_auth.token);
11

12
  let response = await web.conversations.history({
13
    channel: channel,
14
  });
15

16
  return { response: response };
17
}
18

Other submissions
  • Submitted by rossmccrann Deno
    Created 388 days ago
    1
    import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";
    2
    /*
    3
    @param: {string} channel - Conversation ID to fetch history for.
    4
    */
    5
    
    
    6
    type Slack = {
    7
      token: string;
    8
    };
    9
    export async function main(slack_auth: Slack, channel: string) {
    10
      const web = new WebClient(slack_auth.token);
    11
    
    
    12
      let response = await web.conversations.history({
    13
        channel: channel,
    14
      });
    15
    
    
    16
      return { response: response };
    17
    }
    18