Skip to content

Components v2: use valid JSON examples #7535

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

Merged
merged 3 commits into from
May 9, 2025

Conversation

hackermondev
Copy link
Contributor

@hackermondev hackermondev commented Apr 30, 2025

None of these components have proper JSON examples. I'm not sure why, but I'm assuming it's not intentional.

@hackermondev hackermondev requested a review from a team as a code owner April 30, 2025 03:57
@hackermondev hackermondev requested review from anthonydiscord and removed request for a team April 30, 2025 03:57
@leymbda
Copy link
Contributor

leymbda commented Apr 30, 2025

I'd assume it was done that way to show that it belongs in payload's component field, but that isn't the main bit being demonstrated in the example. These updated ones are now showing examples of the full payload_json but are missing the component v2 flag, so if anything I think these are more wrong based on that. If it were to change, I think it'd make most sense to remove the components field entirely and just give the component itself (given that's what the example is supposed to be showing), but its fine as is imo

@hackermondev
Copy link
Contributor Author

@leymbda I think changing the examples just to show the inside of the components array makes the most sense here. I now understand what he was trying to do with the partial, but just having the dangling components field is confusing.

@colinloretz colinloretz added the message components click click click click click click click label May 8, 2025
@anthonydiscord
Copy link
Contributor

anthonydiscord commented May 8, 2025

I'd assume it was done that way to show that it belongs in payload's component field, but that isn't the main bit being demonstrated in the example.

Yeah I was just trying to show as much as I thought was necessary without taking up too much space. I do think yall are right though that this should either contain the flag or just be the components array. I feel like adding the flag is the way to go since we want all our samples to use that going forward. What do you think?

@hackermondev
Copy link
Contributor Author

@anthonydiscord yeah, that's fine. i've updated it to include the full json object with the message flags

Copy link
Contributor

@anthonydiscord anthonydiscord left a comment

Choose a reason for hiding this comment

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

Looks good thank you for thinking through this!

@anthonydiscord anthonydiscord merged commit a652e40 into discord:main May 9, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
message components click click click click click click click
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants