SlashCommand: tell the user when a parameter is missing #835
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
This is my attempt at addressing the main issue that I filed #829 . This patch does not touch any of the subsequent comments in that issue (I do not warn if an extraneous argument is passed to a single-parameter command or attempt to deal with malformed slash commands like simply typing
/
; nor do I touch anything on the backend).matchingSlashCommand
now returns, morally, a union: either a successfulSlashCommand
object or one of two failure strings, which the caller matches on. This allowed the caller's logic to be simplified a bit, which is nice.I am not a typescript person (or, really, a frontend person at all) so I hope this is an idiomatic solution. here is a REPL with some tests.
I was hoping that I'd be able to attach a local frontend to the running backend during this week's Celebration, but it looks like from the README that I still require an API key and a FireBase thingie to do so? If there's a trivial way of pointing it to prod then I'm happy to test it that way, of course.