Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SlashCommand: tell the user when a parameter to a cmd is missing #860

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dijkstracula
Copy link

This is a fresh PR matching #835.

--

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 successful SlashCommand 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant