Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threaded Messaging #131

Open
jonsgreen opened this issue Apr 28, 2017 · 7 comments
Open

Threaded Messaging #131

jonsgreen opened this issue Apr 28, 2017 · 7 comments

Comments

@jonsgreen
Copy link

This is just a general question. Slack finally added threaded messages this year! Is that something that is currently supported by slack-ruby-bot, something in the works or a feature you would be open to getting help on adding to this project?

My particular use case is having a bot match a message and then ask a question back and then capture the response.

@dblock
Copy link
Collaborator

dblock commented Apr 28, 2017

There's nothing special in this gem for those, feel free to contribute.

@Startouf
Copy link
Contributor

I would love to have by default all answers be sent to a thread of the original message (or in the same thread if the original message was itself coming from a thread)

@dblock
Copy link
Collaborator

dblock commented Oct 12, 2017

That makes sense @Startouf, feel free to contribute.

@Startouf
Copy link
Contributor

Startouf commented Oct 14, 2017

So actually it is kinda already supported. However I'm only able to get the first response in thread to work "normally". I'm able to keep sending messages in the same thread but it behaves weirdly. I believe this is what they mentionned there https://github.com/slack-ruby/slack-ruby-client/blob/41539c647ac877400f20aa338aa42d2ebfd2866b/lib/slack/web/api/endpoints/chat.rb#L96

EDIT weirdness fixed with thread_ts: (data.thread_ts || ts) instead of just ts

The following sends a response in a thread

  def self.call(client, data, match)
        client.say(
          channel: data.channel,
          text: 'called',
          thread_ts: (data.thread_ts || data.ts)
        )
      end

@dblock
Copy link
Collaborator

dblock commented Oct 15, 2017

Should this just be a README section? Someone care to PR? Another option is to implement client.reply, but I don't like having to pass data in, so some wrapping should be implemented.

@Startouf
Copy link
Contributor

Startouf commented Oct 18, 2017

It would be nice to have threaded response by default, but indeed seeing the code this seems to require more work. I have started something but I must pause due to a deadline.

I'll be able to resume working on my chatbot chatbot in a while, I will try to have some additional PRs about that.

@dblock
Copy link
Collaborator

dblock commented Dec 2, 2017

Doc added in 162b9e0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants