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

Have processCommand return more information about command execution #70

Open
eritbh opened this issue May 22, 2021 · 0 comments
Open

Have processCommand return more information about command execution #70

eritbh opened this issue May 22, 2021 · 0 comments
Labels
changes: api modifies behavior of the public API enhancement something doesn't happen that should version: major semver-major, involves breaking change

Comments

@eritbh
Copy link
Owner

eritbh commented May 22, 2021

Discord conversation

Currently, custom messageCreate listeners can't get too much information about run commands when calling client.processCommand. It only returns a true or false value that indicates whether a command was run; it doesn't indicate what command was run, and it also treats a command's failing permission checks identically to a message not containing a command at all. The only way around this at the moment is to copy-paste the implementation of processCommand into the custom handler, which isn't well documented and isn't easy to work with.

Ideally, processCommand would return some object describing the execution that's occurred, including the command that was specified (if any), the arguments passed to it (*), and whether or not it was executed (and if not, maybe the permission check that caused the command not to run?). This would be a breaking change.

(* This might cause confusion paired with #25/#68, since the method I'm going with for argument parsing is to do the parsing within the command process rather than before the command is executed. This might result in confusing behavior, and given command arguments can basically be obtained by msg.content.split(' ').slice(1) (as long as your prefix doesn't have spaces), I'm not super convinced it would be worth it to provide the used arguments outside the actual command process.)

@eritbh eritbh added enhancement something doesn't happen that should changes: api modifies behavior of the public API version: major semver-major, involves breaking change labels May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: api modifies behavior of the public API enhancement something doesn't happen that should version: major semver-major, involves breaking change
Projects
None yet
Development

No branches or pull requests

1 participant