I'm trying to figure out the mechanism to post an ephemeral message to a user and then remove it and replace it with a message visible to all. Similar behavior to giphy in which the Slash Command shows an interactive ephemeral message and creates a channel message once the user decides which gif to send. I'm also curious about updating the ephemeral message. I assume this can be done by the response_url if we use an interactive ephemeral message.
I initially figured I'd just create a ephemeral message using chat.postEphemeral and then call chat.delete on it, but it seems chat.delete and chat.update can't be called on a message created using chat.postEphemeral.
The Slack message guidelines seems to suggest that a multi-step interactive flow should always be handled in an ephemeral way so that other channel user don't see all intermediate messages before the result but I'm having bad luck figuring out how to get rid of the ephemeral when done. Probably just being bad at reading but any help appreciated.
Edit with more details:
The documentation around using response_url and postEphemeral states
As you replace messages using chat.update or the replace_original option, you cannot change a message's type from ephemeral to in_channel. Once a message has been issued, it will retain its visibility quality for life.
The message guidelines suggest:
If a user has initiated an action that has multiple steps, those steps should be shown as ephemeral messages visible only to that user until the entire action is complete to avoid cluttering the channel for everyone.
Presumably, I should be able to create an interaction in which I first send an in_channel interactive message.
- When a user initiates an action, I should be able to send them a series of ephemeral messages using the
response_urland passingresponse_type: 'ephemeral'andreplace_original: false? - A new ephemeral interactive message created this way will have its own
response_urlfor making edits, right? - Once I am done with the interactive flow via ephemeral messages, I can modify the original interactive message using its original response_url?
- Lastly, how do I get rid of the last ephemeral edit? Or do I just change it to something like "Workflow completed" and hope for the best? I'm asking because Slash commands obviously seem to have a way to essentially replace the ephemeral message for an in_channel message and I'm trying to figure this kind of workflow out.