Attach emoji reaction to incoming webhooks or slash commands in Slack

Viewed 4942

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?

2 Answers

I used this to add a reaction to a message the slack bot has just sent.

def send_a_message(message, channel):
    message_info = sc.api_call(
        "chat.postMessage",
        channel=channel,
        text=message,
        username='Slack Bot',
        icon_emoji=':robot_face:'
    )

    sc.api_call("reactions.add", name="robot_face", channel=channel, timestamp=message_info['ts'])
Related