Skip to content

Instantly share code, notes, and snippets.

@jeluard
Last active July 3, 2018 15:07
Show Gist options
  • Save jeluard/f834f3c7af94e5306cb976891bc82355 to your computer and use it in GitHub Desktop.
Save jeluard/f834f3c7af94e5306cb976891bc82355 to your computer and use it in GitHub Desktop.

Chat commands are:

  • only available in 1x1 chats
  • identified by a global unique verb
  • associated with a list of arguments
    • typed : free (string, float, int), constrained (query result)
    • can trigger a suggestion component : reuse regular list components?
    • trigger a callback when fired (call an events, visual feedback? always send a message?)
@jeluard
Copy link
Author

jeluard commented Jul 3, 2018

Optional arguments make sense but might be tricky to implement e.g. probably only last ones should be optional, or careful with types.

I actually wouldn't couple messages with commands at all. It should be possible to programatically send any message type with any data, be it from a command or not.

Right

yes, but we should allow a free form (or at least free text) suggestion

Exactly that was my point about typed arguments. string, float would be free by default while events based would be constrained.

@goranjovic
Copy link

Exactly that was my point about typed arguments. string, float would be free by default while events based would be constrained.

Ok, so it's time to bring validation into the discussion. Because even "free" texts or numbers aren't truly free, e.g. they would be lowercase-only, non-empty, larger than zero, etc.

For the constrained ones we'd typically have the default validation that the value has to exist in the list of allowed values. Practically enum type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment