I created a custom slash command in Slack. The backend code, not that it's important, is a Lambda function in Python in AWS.
My problem is that when I enter the slash command, I am the only one who can see the message. Otherwise, it works perfectly. Is there a way to get others to see the output from my custom slash command?
To create a Slash command, enter the https://[yourTeam].slack.com/apps/build/custom-integration URL to your browser's address bar, just replace the [yourTeam] placeholder with the name of your Slack team, and click the Slash Commands option.
With Slash Commands, all you have to do is type / and you're ready to use your favorite bot. You can easily see all the commands a bot has, and validation and error handling help you get the command right the first time. Not every bot might be using Slash Commands right now.
See "'In Channel' vs. 'Ephemeral' responses" here: https://api.slack.com/slash-commands#responding_to_a_command.
By default, the response messages sent to commands will only be visible to the user that issued the command (we call these "ephemeral" messages). However, if you would like the response to be visible to all members of the channel in which the user typed the command, you can add a
response_type
ofin_channel
to the JSON response, like this:{ "response_type": "in_channel", "text": "It's 80 degrees right now.", "attachments": [ { "text":"Partly cloudy today and tomorrow" } ] }
When the
response_type
isin_channel
, both the response message and the initial message typed by the user will be shared in the channel.
If you have a block in your JSON payload to slack (you used slacks block-kit) e.g
`"blocks": []`
you'll have to put the "response_type": "in_channel"
above blocks
for it to work :) e.g
{
"response_type": "in_channel",
"blocks": [....]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With