0
Delete Message
One script reply has been approved by the moderators Verified
Created by aureliejagg29 899 days ago Viewed 9635 times
0
Submitted by rossmccrann Deno
Verified 885 days ago
1
import { WebClient } from "https://deno.land/x/slack_web_api@1.0.3/mod.ts";
2
/*
3
@param: {string} channel - Channel containing the message to be deleted.
4
@param: {string} timestamp - Timestamp of the message to be deleted.
5
*/
6

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

17
  let response = await web.chat.delete({
18
    channel: channel,
19
    ts: timestamp,
20
  });
21

22
  return { response: response };
23
}
24