Archive a channel. Requires channels:manage (bot) or channels:write (user); private channels need groups:write.
1
import { WebClient } from "@slack/web-api"
2
3
/**
4
* Archive Channel
5
* Archive a channel. A bot token must be a member of the channel. Requires channels:manage (bot token) or channels:write (user token) on the connection; a private channel needs groups:write instead.
6
*/
7
export async function main(auth: RT.Slack, channel: string) {
8
const client = new WebClient(auth.token)
9
return await client.conversations.archive({ channel })
10
}
11