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(precondition): use result for PreconditionContainerSingle #535
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want @kyranet 's review on this at the least but it lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh shit. Thanks! Is that async` needed for those?
Oops I forgot to remove those after linting. Fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…redev#535) * fix(precondition): use result for PreconditionContainerSingle * fix: remove unnecessary async * fix: import err directly
PreconditionContainerSingle doesn't use result, so when command-specific preconditions that don't implement the corresponding run method are ran in CorePreChatInputCommandRun.ts the
ChatInputCommandDenied
event isn't emitted (similar issue forCorePreMessageCommandRun.ts
andCorePreContextMenuCommandRun.ts
). The error propagates upwards and emits aListenerError
event instead.This uses an approach similar to PreconditionStore.ts for global preconditions to fix the issue.