0

Add Reaction

by
Published today

Add an emoji reaction to a message. Requires reactions:write on the connection.

Script slack Verified

The script

Submitted by hugo989 Bun
Verified 5 hours ago
1
import { WebClient } from "@slack/web-api"
2

3
/**
4
 * Add Reaction
5
 * Add an emoji reaction to a message identified by its channel and `timestamp` (the message's `ts`). `name` is the emoji name without colons, e.g. "thumbsup". Requires reactions:write on the connection.
6
 */
7
export async function main(
8
  auth: RT.Slack,
9
  channel: string,
10
  timestamp: string,
11
  name: string
12
) {
13
  const client = new WebClient(auth.token)
14
  return await client.reactions.add({ channel, timestamp, name })
15
}
16