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

feat: default select menu values #824

Merged
merged 4 commits into from
Sep 23, 2023

Conversation

jaw0r3k
Copy link
Contributor

@jaw0r3k jaw0r3k commented Sep 21, 2023

Please describe the changes this PR makes and why it should be merged:
Supports default select menu values.

If applicable, please reference Discord API Docs PRs or commits that influenced this PR:

@vercel
Copy link

vercel bot commented Sep 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
discord-api-types ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 23, 2023 9:45am

@Renegade334
Copy link
Contributor

Renegade334 commented Sep 22, 2023

Testing confirms that calling the API with default select menu objects that are type-mismatched from the parent select menu component (eg. providing a select menu component with type: ComponentType.UserSelect but giving a default select menu object of type: "channel") returns a DiscordAPIError[50035]: Invalid Form Body.

Accordingly, I think that SelectMenuDefaultValueType needs to be templated such that type is constrained to match its parent select menu component.

@vladfrangu
Copy link
Member

I was referring to the resolved values, but you can also strictly type the default values if you want!

@Renegade334
Copy link
Contributor

Renegade334 commented Sep 23, 2023

@jaw0r3k: I've addressed the APIMessage change in Renegade334/discord-api-types@58b65c8 and the default value type narrowing in Renegade334/discord-api-types@33cbcea - feel free to pull/modify/steal at your leisure

@Jiralite Jiralite merged commit 1290c94 into discordjs:main Sep 23, 2023
6 checks passed
@jaw0r3k jaw0r3k deleted the default-select-menu-values branch September 23, 2023 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants