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

Slack (and SlackRTM) replyInThread() doesn't reply if message came from a thread #327

Closed
drakenya opened this issue Apr 14, 2017 · 0 comments

Comments

@drakenya
Copy link
Contributor

  • BotMan Version: 1.5.2
  • PHP Version: 7.1.3
  • Messaging Service(s): SlackRTM
  • Cache Driver: none

Description:

The replyInThread() function grabs the message's 'ts' attribute and includes that in the payload it sends. This works for starting a new thread, but it fails for continuing an existing thread. If it tries to post to an existing thread, it just does nothing (sends to Slack, but ends up in oblivion).

It should check if thread_ts is set, and if so use that; otherwise, use ts. Something like this:

$additionalParameters['thread_ts'] = !empty($matchingMessage->getPayload()->get('thread_ts'))
            ? $matchingMessage->getPayload()->get('thread_ts')
            : $matchingMessage->getPayload()->get('ts');

This would be added in SlackRTMDriver->replyInThread() and SlackDriver->replyInThread()

Steps To Reproduce:

Have the bot listen for a message, and use SlackTRMDriver->replyInThread()

Send a message in the channel, and the bot replies in a new thread.

Reply with same message in the thread, and the bot never gets the message to post to that thread.

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

No branches or pull requests

2 participants