Capture a Lita Command to Reuse Later
To capture a Lita command, you need to stub out three routes. The main route captures a message, while the other two manage the scheduled messages, one to show the list and the other to empty it out.
| route(/^schedule\s+"(.+)"\s+in\s+(.+)$/i, :schedule_command, command: true) |
| route(/^show schedule$/i, :show_schedule, command: true) |
| route(/^empty schedule$/i, :empty_schedule, command: true) |
The expected use for each of the three routes is as follows:
| > Lita schedule "double 2" in 5 seconds |
| > Lita show schedule |
| > Lita empty schedule |
The first route uses a regular expression ...
Get Build Chatbot Interactions now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.