Back to Parent

Future Work

Through the process of making breatheIO bot, I became familiar with Slack webhooks and the Slack API. I learned how authorization works in apps, using an oAuth endpoint to authorize users securely. While I found it straightforward to use template code to generate text and/or JSON attachment responses based on trigger words, I struggled with interpreting user responses within a chat flow and using those responses like variables to trigger methods, like the breath counter.

For editing the breath length, in this iteration, I used regular expressions to identify numbers in responses at any point in the chat and then use that number as a parameter for a counter method. However, in the future I would like to refactor the code to only play an edited breath counter at the proper point in the conversation flow, and also allow multiple responses.

I also struggled with some of Slack's default error messages, which showed as ephemeral messages even when there was no error — such as a timeout message that displays because the counter response deliberately lasts over 3 seconds (Slack's timeout limit) and an error upon clicking interactive buttons that displayed along with the correct responses. In general, I found Slack apps weren't intuitive to test and debug, since I couldn't (as far as I know) rely on console logging and viewing the source as debugging methods. I would look more into using cURL and other ways of testing and debugging my app.

Finally, I ran out of time to implement the scheduling feature (not shown) with the Heroku scheduler. I couldn't find any sample code for adding a rake task to the Heroku scheduler based on a variable in the user's response (for example "every day" or "every hour"). I hope to research this more and implement scheduling in my next iteration. I also hope to explore other features, such as allowing users to customize number of breaths, as well as the gif they would like to display.

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!