I have created a slack slash command "/myMeetings", this is actually been configured with a requestURL - https://slack.mycompany.com/slack
So now my use case is to send a response which is having two text messages, one of the type ephemeral and other message for in_channel
request_type - in_channel
and
request_type - ephemeral
something like this
[
{
"response_type": "in_channel",
"text": "This message will be shown to the entire channel"
},
{
"response_type": "ephemeral",
"text": "only shown to the user who initiates slash command"
}
]
How can i achieve this behaviour?
You can only send one direct response to the Slash command request and it can only be either in_channel
or ephemeral
. So the suggested syntax will not work.
However, to achieve your requirement you could simply post a message in addition to the response, with chat.postMessage
for in_channel or chat.postEphermal
for ephemeral. You will get the channel ID in the slask response request, so you know where to send the message to.
Note that there are some special considerations with the approach:
chat.write.bot
)