edgi-govdata-archiving / edgi-hubot-halpy

Heroku-backed chatbot-friend who lives in EDGI Slack
https://edgi-hubot.herokuapp.com/
3 stars 0 forks source link

Add date/time parsing to zoom.coffee #37

Closed titaniumbones closed 5 years ago

titaniumbones commented 5 years ago

It would be really helpful to be able to add a date to a halpy zoom creation command. Right now hte usefulness of hte script is limited.

titaniumbones commented 5 years ago

The chrono js library looks promising for this: https://github.com/wanasit/chrono

There are also some examples of datetime parsing in other hubot scripts, but they're a little hard to read.

In any case the ain work would be to update the robot respond regex. I think if we were doing NL parsing then we'd actually simplify the regex to something like /"zoom me ( .*)/i and then submit msg.match[1] to some more complex parsing. chrono can help with this I think, or we could just be quite rigorous in our requirements & write a more helpful help message. (note: it's now recommended to name the callback parameter 'res' for semantic reasons).

titaniumbones commented 5 years ago

THis is now operational. Relieso n moment.js as well as chrono-node. Currently feels a little inefficient but procesisng power is not really an issue here for this very low-use tool.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in seven days if no further activity occurs. If it should not be closed, please comment! Thank you for your contributions.