[Feature] Post ephemeral message using responseURL#27
Open
SirensOfTitan wants to merge 2 commits intomaxchehab:masterfrom
Open
[Feature] Post ephemeral message using responseURL#27SirensOfTitan wants to merge 2 commits intomaxchehab:masterfrom
responseURL#27SirensOfTitan wants to merge 2 commits intomaxchehab:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows for use of
response_urlincoming webhook to post an ephemeral message (a common pattern after closing a modal, for example). It could easily be applied to message too, but I figured ephemeral was a good starting point.Unfortunately, when posting a message or ephemeral message using
response_url, slack doesn't give back themessage_ts, just an "ok" or error code. To work around, I'm using theresponse_urlas the key for the phelia cache instead ofchannel_id:message_ts. I prefix eachaction_idwith the response_url transparently , then use that URL to look up the cache we need.One caveat:
response_url, I think, can be used up to three times within a 30-minute timeframe. I just assume that we use it to post one-and-only-one message. We may want to enforce this by ensuring the phelia cache incurs a miss when callingpostEphemeralResponse.Followups that would be valuable:
postMessageResponseas well.Very happy to work on those if we're feeling this is a good direction.