justicenation / slashclock

/clock concept as a new Slack app
GNU General Public License v3.0
0 stars 0 forks source link

Gracefully handle unknown command #22

Closed martyychang closed 6 years ago

martyychang commented 6 years ago

Right now, when a user types an unrecognized command, an ugly HTTP 500 error is displayed as shown below.

image

Instead, it would be better for a more user-friendly message to be displayed, so the user knows what he or she did wrong. Below is a sample message from Slack displayed when an invalid command is entered.

image

martyychang commented 6 years ago

As a bonus it may be cool to check whether the Levenshtein distance between the bad command and a known command is 1, in which case the known command can be suggested as what the user was trying to execute

martyychang commented 6 years ago

I think it would make more sense to create the generic "help" functionality in #23 before tackling this issue, because for truly unknown or unrecognizable commands the user should be referred to /clock help as the default feedback