Actions
Add Reaction
Actions
Add Reaction
Add a reaction to a message in Slack.
Adds an emoji reaction to a message in Slack. Useful when using the blockActionInteraction event.
Params
keyrequired
string
A unique string. Please see the Keys and Resumability doc for more info.
optionsrequired
object
namerequired
string
The name of the emoji to add as a reaction (without colons). (Check out this emoji cheatsheet to see what’s available.)
timestamprequired
string
The timestamp of the message to add the reaction to. E.g. 1631234567.123456
.
channelName
string
The name of the channel, can optionally include the #
. E.g. #team
.
Alternatively you can use the channelId
param.
channelId
string
The slack ID of the channel, e.g. C04GWUTDC4W
. Can be used instead of channelName
. Use channelId
if the slack channel name could change.
Response
okDefault: "true"
boolean
Always true; non-ok responses will halt the workflow run and throw an error.
Example Workflows
import { Trigger } from "@trigger.dev/sdk";
import * as slack from "@trigger.dev/slack";
new Trigger({
id: "slack-block-interaction",
name: "Slack Block Interaction",
on: slack.events.blockActionInteraction({
blockId: "issue.action.block",
actionId: ["status-blocked", "status-help", "rating"],
}),
run: async (event, ctx) => {
return slack.addReaction("Adding a funny reaction to the message", {
name: "laughing",
timestamp: event.message.ts,
channelId: event.channel.id,
});
},
}).listen();