slack slash command with node-slack-sdk

521 Views Asked by At

I'm facing Slack API for the first time.

I'm trying to implement a slash command; I found this tutorial:

https://github.com/slackapi/template-slash-command-and-dialogs

but it seems it doesn't use the slack node-slack-sdk. After some hour I wasn't able to find anything in the SDK about the slash commands.

Did I missed something or actually the Slack SDK doesn't offer a slash command SDK?

BTW I was able to successfully configure a slash command, I just want to know if it would be possible to do it with slack node-slack-sdk to keep coherence in the code.

1

There are 1 best solutions below

4
On

Slash commands are added in the Slack app's settings page.

https://api.slack.com/apps/A1234567/slash-commands?

(where A1234567 is your app ID)

These generate events similar to the Block elements and send POST data to your designated end node.

I don't use an SDK (my CGI is BASH) so I can't speak to how/if they differentiate events generated by slash commands versus other events.

To answer the question, I believe the slash command handling should be documented in here:

https://slack.dev/node-slack-sdk/interactive-messages