Just playing with my first slack command. Is there any way of adding custom data from an external API for autocomplete. So what works perfectly right now, is calling the command /assign
plus a slack user (both will be autocompleted, nice!). What I want/need is a list of items I would fetch from a remote endpoint, which can be selected by autocomplete.
Is this possible at all?
/assign @userX to [data_by_autocomplete]
Or do I need to solve that by a full conversation like:
=> /assign user @userX
=> BOT: Which task? Here is a list: ...
=> /assign taskY
=> BOT: Assigned TaskY to @userX
But this feels very cumbersome (and wrong). So basically what I want is a remotely fetched list for autocomplete in the same command.
PS: Command and functionality is a simplified example to illustrate the point.
Go to https://api.slack.com/apps and select your app to create Slash command. Note: Below instructions are given just for reference, you must follow updated instructions given in https://api.slack.com/apps. On the Slack API page, click the Slash Commands tab. Click Create New Command.
To generate a modal, an app will need to compose an initial view. Apps can compose view layouts and add interactivity to views by using Block Kit. A modal can hold up to 3 views at one time in a view stack.
No, you can not use custom autocomplete within the command line, but you can use custom autocomplete with the the new interactive message menus.
So I would suggest to break it up into two steps.
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