Skip to content

Changed CommandGroup ExecuteAsync to throw CommandNotFoundException

Created by: DWaffles

Summary

Changed it to where D#+ throws a CommandNotFoundException when a user tries to execute an invalid command with a command group.

Changes proposed

  • CommandGroup ExecuteAsync now throws a CommandNotFoundException instead of an InvalidOperationException if no matching subcommands were found and the group is not executable
  • Modified TestBot's CommandErrored handler to inform user no command was found (and to allow testing of the change)

Notes

  • CommandNotFoundException only has a single property for the command name. Rather than adding an other property for the group name, the command name will contain both the group and invalid command if applicable
  • TestBot does not log an error the console as it's a user created error
  • This is my first PR and contribution to the library so if there any errors or mistakes let me know

Merge request reports