Respond to a message in a Slack channel in a thread
Hi there!
Here’s what I’m trying to do:
When someone sends a message in a channel (any message), I would like to trigger a response in a thread with a canned message. I know it’s possible to send a dm or to reply in the channel, but it would be ideal if it could happen in a thread on the person’s message so the channel doesn’t get too noisy.
Thanks!
Page 1 / 1
Ok that can be done too, but this is a little more complicated.
What needs to happen is to determine if the message is in a thread or not.
Among the data available from Slack, there are two ts fields, one is the message timestamp, and the other the thread timestamp thread_ts.
When these both have exactly the same value then it is channel message, and when they are different it is a thread message.
So now in Zapier, we need some way to determine if they are the same or not and if they are send the canned message.
Since both the values are Numbers, we can use a Formatter step with a spreadsheet-style formula to do a comparison.
So Now the steps look like:
Use the “New Message posted to channel” slack trigger,
Compare if the TS field value is the same as the THREAD_TS field value
then filter out BOTS AND Thread messages
Then “Send Channel Message” making sure to use the Trigger thread timestamp in the Thread field.
I got it working so that when someone sends a message in the specified channel the bot autoreplies to them with a canned message in a thread.
The issue I am running into now is that when I respond to the thread, the bot sends me the message as well. Do you know if it’s possible to only have the bot respond to a channel message, not a reply on a thread?