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

fix: supportsXCommands() methods now use SubcommandMappings #398

Merged
merged 1 commit into from Dec 10, 2022

Conversation

BenSegal855
Copy link
Contributor

This PR changes the behavior of the supportsMessageCommands() and supportsChatInputCommands() methods on the subcommand class. Previously, these both would always return true since the methods inherited from the Command class just check for the existence of a messageRun() or chatInputRun() method. Since both methods are implemented on the Subcommand class, the type guards would always return true. This PR instead determines the output of these methods by checking if a messageRun or chatInputRun property was provided on any of the subcommands in the parsedSubcommandMappings array. These changes were tested using commands with all combinations of having a messageRun, having a chatInputRun, having both, having groups, and not having groups. Test commands can be found in this gist.

@favna favna merged commit 3e7a45a into sapphiredev:main Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants