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(precondition): use result for PreconditionContainerSingle #535

Merged
merged 3 commits into from Oct 1, 2022
Merged

fix(precondition): use result for PreconditionContainerSingle #535

merged 3 commits into from Oct 1, 2022

Conversation

feefs
Copy link
Contributor

@feefs feefs commented Sep 18, 2022

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 for CorePreMessageCommandRun.ts and CorePreContextMenuCommandRun.ts). The error propagates upwards and emits a ListenerError event instead.

This uses an approach similar to PreconditionStore.ts for global preconditions to fix the issue.

@feefs feefs changed the title fix(precondition): use result for PreocnditionContainerSingle fix(precondition): use result for PreconditionContainerSingle Sep 18, 2022
favna
favna previously approved these changes Sep 20, 2022
Copy link
Member

@favna favna left a 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

vladfrangu
vladfrangu previously approved these changes Sep 21, 2022
Copy link
Member

@vladfrangu vladfrangu left a 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?

@feefs feefs dismissed stale reviews from vladfrangu and favna via 3bcae2e September 21, 2022 16:48
@feefs
Copy link
Contributor Author

feefs commented Sep 21, 2022

Oh shit. Thanks! Is that async` needed for those?

Oops I forgot to remove those after linting. Fixed!

favna
favna previously approved these changes Sep 21, 2022
Copy link
Member

@favna favna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't let Kyra get a connect-three

image

@favna favna merged commit 05167f4 into sapphiredev:main Oct 1, 2022
r-priyam pushed a commit to r-priyam/sapphire-framework that referenced this pull request Oct 3, 2022
…redev#535)

* fix(precondition): use result for PreconditionContainerSingle

* fix: remove unnecessary async

* fix: import err directly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants