1

Set Channel Purpose

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
type Slack = {
4
  token: string;
5
};
6
export async function main(
7
  slack_auth: Slack,
8
  channel: string,
9
  purpose: string
10
) {
11
  const web = new WebClient(slack_auth.token);
12

13
  await web.conversations.setPurpose({
14
    channel: channel,
15
    purpose: purpose,
16
  });
17

18
  return { message: "Successfully updated channel purpose" };
19
}
20

Other submissions
  • Submitted by rossmccrann Deno
    Created 384 days ago
    1
    import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";
    2
    
    
    3
    type Slack = {
    4
      token: string;
    5
    };
    6
    export async function main(
    7
      slack_auth: Slack,
    8
      channel: string,
    9
      purpose: string
    10
    ) {
    11
      const web = new WebClient(slack_auth.token);
    12
    
    
    13
      await web.conversations.setPurpose({
    14
        channel: channel,
    15
        purpose: purpose,
    16
      });
    17
    
    
    18
      return { message: "Successfully updated channel purpose" };
    19
    }
    20