Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

bot.replyPrivateDelayed can't send ephemeral message in response to button action #444

Closed
sundeepgupta opened this issue Oct 13, 2016 · 2 comments

Comments

@sundeepgupta
Copy link
Contributor

sundeepgupta commented Oct 13, 2016

Lets say X does a slash command that causes our app to post a message as X (i.e. as_user is true) in the channel. The message contains an interactive message button. Now Y comes along and clicks the button. Our app responds to Y using replyPrivateDelayed with msg object of {"text": "hello"}. In other words, we want to reply to Y with "hello" ephemerally. We don't want to update/delete X's message, it should remain in the channel.

The result we're seeing is X replaces the original post with the button with a plain text post, "hello".

After experimenting more, it turns out that we also need to msg.replace_original = false to get the expected behaviour.

I created a branch with a simple fix, however not sure if this is the best way to go about it. Also it would be a breaking API change.

sundeepgupta added a commit to sundeepgupta/botkit that referenced this issue Oct 16, 2016
I discovered this when trying to ephemerally respond to an interactive button click. We need to set `replace_original` to `false` in order for our reply to be ephemeral. Otherwise, it will reply publicly.
@sundeepgupta
Copy link
Contributor Author

sundeepgupta commented Oct 16, 2016

Update: we can can always set replace_original to false so we don't need to pass in an an extra argument. Thereby, fixing without breaking existing API. Created a PR: #446

sundeepgupta added a commit to sundeepgupta/botkit that referenced this issue Oct 27, 2016
I discovered this when trying to ephemerally respond to an interactive button click. We need to set `replace_original` to `false` in order for our reply to be ephemeral. Otherwise, it will reply publicly. Furrther, when responding to an ephemeral message's button click, currently we cannot update it. Thus, introduce new method to provide the option to update or not. The existing one could be depcrecated.
sundeepgupta added a commit to sundeepgupta/botkit that referenced this issue Oct 27, 2016
I discovered this when trying to ephemerally respond to an interactive button click. We need to set `replace_original` to `false` in order for our reply to be ephemeral. Otherwise, it will reply publicly. Furrther, when responding to an ephemeral message's button click, currently we cannot update it. Thus, introduce new method to provide the option to update or not. The existing one could be depcrecated.
@sundeepgupta
Copy link
Contributor Author

This is not an issue: See benbrown's comment: #446

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

No branches or pull requests

2 participants