slacker
slacker copied to clipboard
Framework for slash commands
Bots would also be very useful if they could be the engine behind slash commands - https://api.slack.com/slash-commands
Would you be interested if I put together a pull request to add some functionality like this? Similar to the existing chat functionality, a DSL for creating custom commands? And preference in which direction I take it?
Yes, this would be quite a neat feature to have, though I'm not sure it's possible.
When a message begins with a /, slack tries to send it to @slackbot, who will either handle the command and its arguments, or throw saying it can't handle it, as in this case:

Listening in on the webhook, it doesn't actually seem that these messages that are prefixed with a / actually get sent down the wire. Now, if we could figure out a way to handle /commands by using webhooks, that would be ideal, but I'd rather not add another message gathering mechanism to the slack part of slacker.
The alternative is to change this pattern to accept (instead of @slacker), a single !, or similar to replace the slash. This would look like:
!my-command args
Thoughts?
According to the slack docs, it's just a case of adding the /command via the web interface as well, then it will post via a webhook. It's not ideal, but generally you don't need to keep messing with these commands once they're setup.