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(MessageComponentInteraction): component getter #5840

Merged
merged 7 commits into from Jun 26, 2021

Conversation

monbrey
Copy link
Member

@monbrey monbrey commented Jun 13, 2021

Closes #5828

This currently uses generic Object/unknown typings for a raw message component, pending discordjs/discord-api-types#132 being merged.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

@monbrey monbrey marked this pull request as draft June 13, 2021 01:35
src/structures/MessageComponentInteraction.js Outdated Show resolved Hide resolved
get component() {
return this.message.components
.map(row => row.components)
.flat()
Copy link
Member

Choose a reason for hiding this comment

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

Is flat defaulted to Infinity?

Copy link
Member Author

Choose a reason for hiding this comment

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

Default depth is 1, though not sure it makes a difference here based on the data the API gives us.

@monbrey monbrey marked this pull request as ready for review June 22, 2021 21:36
@iCrawl iCrawl requested a review from vladfrangu June 22, 2021 22:39
@vladfrangu
Copy link
Member

The required types PR is merged and deployed as a next version, but not as a release yet! I want to restructure some things in there, so... for now, should we target @next? CC @iCrawl @kyranet

Copy link
Member

@SpaceEEC SpaceEEC left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

src/structures/MessageComponentInteraction.js Outdated Show resolved Hide resolved
@iCrawl
Copy link
Member

iCrawl commented Jun 24, 2021

Lint CI is failing here.

@iCrawl
Copy link
Member

iCrawl commented Jun 24, 2021

This needs a rebase too.

monbrey and others added 7 commits June 25, 2021 07:33
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Jan <66554238+vaporox@users.noreply.github.com>
@iCrawl iCrawl merged commit 1439183 into discordjs:master Jun 26, 2021
@monbrey monbrey deleted the component-getter branch June 26, 2021 10:45
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

property/method to concisely reference originating component of a component interaction
7 participants