Reputation: 287380
I implemented a slash command in Slack that calls an AWS Lambda function and in return, the Lambda function needs to run some other Slash commands in Slack. What's the best way of doing this?
Is it possible to do it through the webhook of a channel? So that instead of just posting text, it runs the commands. This would be very convenient since it's so straightforward (the app is an internal app by the company, so hardcoding a webhook is entirely valid).
If not, what's the next possible solution?
I'm aware of these two questions:
but they are quite old and point to a Python package that has been abandoned.
Upvotes: 1
Views: 1142
Reputation: 9717
I think the command is hidden because of security concerns, because you can run other apps other than your own. You cant execute the command but your app could give the user the ability to excute it manually, by clicking a button for example.
I think you can do the following:
Use Asynchronous responses and use response_url
parameter in the payload. this will execute along process and wait for a response.
Also you could use modal response with 'trigger_id' and generate and use a webhook in 3 seconds or it will expire.
Upvotes: 0