git-for-windows / gfw-helper-github-app

2 stars 6 forks source link

Display error messages upon incorrect/unrecognized slash commands #31

Open dscho opened 1 year ago

dscho commented 1 year ago

In https://github.com/git-for-windows/MSYS2-packages/pull/92#issuecomment-1471782841, we tried to add release notes, but the syntax of the slash command is very strict and requires a "release note type".

However, there was no feedback that anything was amiss.

Let's respond to incorrect or unrecognized slash commands with a helpful error message, probably as a new issue comment that at-mentions the actor and references the invocation (at least if the actor is allowed to issue slash commands).

The best way to implement this is probably to wrap the handling of all slash commands that need permission (i.e. everything except /hi) in a try { ... } catch(e) { reply(...) } block, and also warn about any /add command that does not match that very precise regular expression.