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(MessageComponents): clickybois (MessageButton, MessageActionRow, associated Collectors) #5674

Merged
merged 55 commits into from Jun 4, 2021

Conversation

monbrey
Copy link
Member

@monbrey monbrey commented May 25, 2021

No longer with the broken rebasing I accidentally introduced in #5656

For anyone curious, buttons look like this:

image

This includes:

  • New MESSAGE_COMPONENT Interaction type ComponentInteraction
  • A base MessageComponent class
  • New MessageActionRow component class
  • New MessageButton component class
  • ComponentInteractionCollector class and associated Message methods

I've so far modelled the components similarly to MessageEmbed
MessageButton is a builder class and MessageActionRow has methods similar in design to MessageEmbed#addFields for adding MessageButtons and any other future components they can hold.
Similarly, it should be possible to use raw object formats in the Message payload in the same way embeds can be included.

Status and versioning classification:

  • Code changes have been tested against the Discord API
  • I pretend to know how to update typings and have done so
  • This PR changes the library's interface (methods or parameters added)

@stijnvdkolk
Copy link

stijnvdkolk commented May 26, 2021

Components are only available in specific guilds - you will not be able to use these new methods yet.

They are released now.

typings/index.d.ts Outdated Show resolved Hide resolved
src/structures/BaseMessageComponent.js Outdated Show resolved Hide resolved
src/structures/BaseMessageComponent.js Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
typings/index.d.ts Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
typings/index.d.ts Show resolved Hide resolved
typings/index.d.ts Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
src/structures/ComponentInteraction.js Outdated Show resolved Hide resolved
typings/index.d.ts Show resolved Hide resolved
src/structures/BaseMessageComponent.js Outdated Show resolved Hide resolved
src/structures/Interaction.js Outdated Show resolved Hide resolved
src/structures/Message.js Outdated Show resolved Hide resolved
src/structures/MessageButton.js Outdated Show resolved Hide resolved
@monbrey
Copy link
Member Author

monbrey commented May 26, 2021

Draft PRs, by definition, are not ready for review.

Nobody should be using this, as the description clearly indicates.

typings/index.d.ts Outdated Show resolved Hide resolved
@iCrawl iCrawl merged commit cbd7f2b into discordjs:master Jun 4, 2021
@MahouSirin
Copy link
Contributor

Woohoo 🎉

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.

Request for adding support for message components