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

Parse interaction options with sapphire resolvers #358

Closed
1 task done
noftaly opened this issue Jan 10, 2022 · 3 comments · Fixed by #503
Closed
1 task done

Parse interaction options with sapphire resolvers #358

noftaly opened this issue Jan 10, 2022 · 3 comments · Fixed by #503
Assignees
Milestone

Comments

@noftaly
Copy link
Contributor

noftaly commented Jan 10, 2022

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

Maybe we should add a way to parse interaction options with sapphire resolvers?

Because there aren't many Discord's default types, so maybe Sapphire can offer a better api than manually importing resolvers...

Desired solution

const args = this.parseOptions(interaction); // Method in the core SapphireCommand class
args.get('option-name', 'date');
args.get('option-name2', 'hyperlink');
args.get('option-name3'); // Resolve with the discord's type entered in the option array.
// and so on

Alternatives considered

Using resolvers imported manually. It would work, but adding syntactic sugar: that's what a framework is for :)

Additional context

Vladdy told me on discord this was considered, but needs a refactor of the Arguments class to make it more abstract, so I thought I'd put it there as a reminder.

I'm willing to work on this if needed.

@favna
Copy link
Member

favna commented Jan 10, 2022

Resolvers to be fully compatible with interactions is just one of many things that still needs doing before release yeah.

@favna favna added the feature label Jul 24, 2022
@favna favna added this to the v3 milestone Jul 24, 2022
@favna favna self-assigned this Jul 27, 2022
@favna
Copy link
Member

favna commented Jul 27, 2022

This will be split in 2 parts. In v3 of the framework you will be able to directly call the various resolvers and pass interactions into them, i.e. for resolveMessage this is relevant. In v4 we will have Args support for interactions.

@favna
Copy link
Member

favna commented Jul 27, 2022

This particular issue will be closed as part of v3, and the Args support has been moved to #494

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

Successfully merging a pull request may close this issue.

2 participants