Node-slack-sdk: chat.postMessage reply_broadcast option has no effect

Created on 9 Nov 2020  路  3Comments  路  Source: slackapi/node-slack-sdk

Description

When using chat.postMessage with reply_broadcast = false the message is visible to the entire channel.

What type of issue is this? (place an x in one of the [ ])

  • [x] bug
  • [ ] enhancement (feature request)
  • [ ] question
  • [ ] documentation related
  • [ ] testing related
  • [ ] discussion

Requirements (place an x in each of the [ ])

  • [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [x] I've read and agree to the Code of Conduct.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Packages:

Select all that apply:

  • [x] @slack/web-api
  • [ ] @slack/events-api
  • [ ] @slack/interactive-messages
  • [ ] @slack/rtm-api
  • [ ] @slack/webhooks
  • [ ] @slack/oauth
  • [ ] I don't know

Reproducible in:

package version: @slack/web-api 5.13.0

node version: v12.13.0

OS version(s): OSX Mojave 10.14.6

Steps to reproduce:

  1. Send a message as a bot with web.chat.postMessage with reply_broadcast: false

Expected result:

The message is posted to the channel but only visible to the user who triggered the bot to send the message.

Actual result:

The message is posted to the channel and visible to everyone.

Attachments:

You can also replicate this using the tester tab for the method in the API documentation

question

All 3 comments

Hi @hopemiller14,

Thanks for submitting this issue and providing the detailed steps to reproduce!

The chat.postMessage parameter reply_broadcast: <boolean> is used when replying to a threaded message and determines whether the response is also sent into the Slack channel. When it's set to false, the reply it only displayed in the the thread. When true, it's also displayed in the channel.

This is the same action as when a user checks the box "Also sent to #channel":
image

It sounds like you'd like to display a message that's only visible to a specific user. You can do this with the chat.postEphemeral method, which will display a message that's only visible to a specific user. You can send the message to a channel or as a reply in thread (using thread_ts).

Hope that helps and please let me know how that goes!

Ah yes, thank you @mwbrooks! chat.postEphemeral is exactly what I needed!

Awesome @hopemiller14! Good luck with the app! 馃殌

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hckhanh picture hckhanh  路  21Comments

gyunaev picture gyunaev  路  12Comments

danielravina picture danielravina  路  16Comments

aoberoi picture aoberoi  路  10Comments

bmajz picture bmajz  路  14Comments