netromdk / slacker

Slacker - Easy access to the Slack API and admin of workspaces/teams.
MIT License
14 stars 0 forks source link

Command validation #24

Closed netromdk closed 6 years ago

netromdk commented 6 years ago

Each command to be registered, must first be validated and if it don't pass an exception must be thrown.

Implement non-abstract Command.validate() in which we can enforce our validations, such as using only [\w\d\.] for command names and aliases, that aliases cannot be a set of one element (because it will then be interpreted as that one element and not a set) etc.

This validation is also valuable when people start contributing commands later on. Then we just require them to run slacker once before submitting a PR.