botium-bindings
botium-bindings copied to clipboard
Timeline to support slash commands for Slack Bots
Hi, is there a tentative date for slash command support? If there are any tips on how the existing testmybot can be modified to support slash commands, that would be helpful too. Thanks!
Hi it is on my todo list to enhance support for slackbots. This is still rather poor. It shouldnt be too much effort though, most work to be done in the slackmock-package, probably in the function called "hears".
Hi, in an attempt to support slash commands, I made some changes (accessible from here - https://www.dropbox.com/sh/4koctzqfuj7f7rw/AACW2iWUoWqFdb4sO-ZuRIK0a?dl=0). I made use a separate directory spec/slash similar to spec/convo, for slash command files. Made simple assumption that the test starts with one direct convo (so that team registration and welcome messages are taken care) and then the slash commands are run.
Here is the current behavior observed:
- Conversation continues to work as in your original version
- Bot receives the slash command and sends the response. I can see it from my Bot's debug statements. However, the mock is not receiving the response that the Bot sends.
Thanks!
I can make you a collaborator for this project so we could work on this topic in a feature branch. Would be more easy than sharing code in dropbox ...
Sure. I guess it would be a minor change to make slash commands work. Do you see anything obvious in the code I sent? I tried with different request_urls (like https://hooks.slack.com/.... and https://slack.com/...., http://...), but none of them brings the slash command responses to the mock. I think the mock connection is good because convo messages work well. Thanks!
What bot are you testing with ? A possible problem could be that the current slack-mocker doesn't react to ephemeral responses, just to delayed responses. I think the slash commands could be integrated into the normal conversation flow by making the slack-mocker recognize the command (checking for "/" + word ...). so no extra treatment outside of the mocker required.
I am testing a new bot not yet released to the public.
I also tested by changing the "hears" method alone to accommodate commands starting with "/" and see the same behavior (of bot response not reaching the mock). Got the invite to collaborate. Do you want me to checkin the partial code?
yes, please create a feature branch and open a pull request to see the changes! We will see if I can help then!
Opened pull request. Thanks!