slack-ruby / slack-ruby-bot

The easiest way to write a Slack bot in Ruby.
MIT License
1.12k stars 187 forks source link

Replying in thread to my own message #218

Open davich opened 5 years ago

davich commented 5 years ago

I'm writing a command and I want to client.say something then reply to that in a thread with more details. At the moment, I have no way of getting the data.ts or data.thread_ts that I need to make a threaded message. client.say just returns true/false.

Thanks

dblock commented 5 years ago

I would appreciate a PR that changes this, please.

davich commented 5 years ago

From a quick look, it appears that the information isn't returned by slack-ruby-client. But I'm no expert. Any suggestions for where this info would be? Thanks

dblock commented 5 years ago

That's where any fix should go and that's where I would look.

jillguyonnet commented 4 years ago

Just want to highlight a workaround in the mean time:

last_message = client.web_client.conversations_history(channel: data.channel, limit: 1).messages.first
say(channel: data.channel, text: '...', thread_ts: last_message.ts)