Reputation: 199
how can I quote a message sent with the Slack api? I couldn't find a method for this function in the documentation. Do you have any suggestions?
Upvotes: 1
Views: 916
Reputation: 199
I solved the problem by making unfurl_links = true with chat.postMessage method. In order to show the text without a link in the message, text = Test <www.example.com| > in url I solved the problem by leaving a space after the "|" sign.
Here is ex. cURL:
curl --location --request POST 'https://slack.com/api/chat.postMessage' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer xoxb-xxxx' \
--data-urlencode 'channel=#urltest' \
--data-urlencode 'text=*TEST*<https://xx.slack.com/archives/xx/p16547134235899399| >' \
--data-urlencode 'unfurl_links=true'
Upvotes: 0
Reputation: 3858
It's not currently possible to "quote" messages in the same way that the native quote feature does this, but if you include a permalink to the message in the body of the new message, the client should unfurl it for a similar look and feel.
Upvotes: 2