hubot-stackstorm
hubot-stackstorm copied to clipboard
Support responding in thread (Slack)
Hi, I want to confirm if there is plan to support sending response from stackstorm to the command originating thread. Acknowledgement message from Hubot is sent in the same thread but response from chatops.post_message action is sent to channel instead of thread.
Proposal Solution:
- Set thread id here https://github.com/StackStorm/hubot-stackstorm/blob/master/lib/utils.js#L113
- Send it to stackstorm by including here https://github.com/StackStorm/hubot-stackstorm/blob/master/scripts/stackstorm.js#L294
- Update chatops.post_message to support thread_id param similar to channel https://github.com/StackStorm/st2/blob/master/contrib/chatops/actions/post_message.yaml#L24
- Update slack postdatahandler to send to correct thread https://github.com/StackStorm/hubot-stackstorm/blob/master/lib/post_data.js#L28
I don't think anyone else has any plans to work on that, so go ahead and create a PR. The main thing to be aware of is not breaking non-Slack chat adapters.
Yes, I would be interested in a PR for this.
@shreyas-shinde since this is a Slack specific feature, is it possible to use the extra.slack
parameter to pass the thread_id
? This would avoid adding a non-generic parameter to chatops.post_message
action.