Search code examples
webhooksemojislack

Attach emoji reaction to incoming webhooks or slash commands in Slack


I would like to a send a message into Slack and automatically add a reaction. I dont mean the emoji within a message, but the reactions below:

enter image description here

I've read the API documentation at it offers a bunch of ways to style the message, even adding buttons. Example Message:

enter image description here

I can not find any way to attach reactions however. Is there any way to add reactions automatically?


Solution

  • To my knowledge you can not add reactions directly as part of an incoming webhook or response to a Slash command.

    Instead you need to call the API method reactions.add to add reactions to an item in Slack, which can be a message.

    To make that work with slash commands, I would suggest posting your message with chat.postMessage instead of using the slash command response. That way you get the timestamp of the message, which you can then use to add reactions.