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

Support components (buttons and dropdowns) #1369

Merged
merged 25 commits into from Jun 11, 2021

Conversation

HarmoGlace
Copy link
Contributor

@HarmoGlace HarmoGlace commented May 28, 2021

This PR adds support to components, as per discord/discord-api-docs#3007 (see https://discord.com/developers/docs/interactions/message-components).

Others relevant PRs: discord/discord-api-docs#3012, discord/discord-api-docs@06218a9

This PR also adds support to dropdowns. There is no official public documentation currently, I implemented it thanks to discordjs/discord.js#5692.

This PR is the continuation of #1364

This has been tested.

@HarmoGlace HarmoGlace changed the title Dropdowns Support components (buttons and dropdowns) May 28, 2021
@HarmoGlace HarmoGlace marked this pull request as ready for review May 29, 2021 12:38
Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
@arqunis arqunis added enhancement An improvement to Serenity. model Related to the `model` module. builder Related to the `builder` module. labels May 31, 2021
@arqunis arqunis added client Related to the `client` module. collector Related to the `collector` module. labels May 31, 2021
@Suyashtnt
Copy link

maybe add an example on how to use them with serenity? Would help new discord bot devs

Copy link
Member

@drklee3 drklee3 left a comment

Choose a reason for hiding this comment

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

Just some very minor doc fixes, otherwise looks good 👍

src/builder/create_components.rs Outdated Show resolved Hide resolved
src/builder/create_components.rs Outdated Show resolved Hide resolved
src/collector/component_interaction_collector.rs Outdated Show resolved Hide resolved
Co-authored-by: Derrick Lee <github@dlee.dev>
arqunis pushed a commit that referenced this pull request Jun 3, 2021
This removes the early return when handling `reaction_filters` on a non-reaction event. This fixes collector filters that may run after the reaction filter but are incorrectly skipped, such as in #1369.  If using component interaction filters and there are existing reaction filters, it will return early on `Interaction Create` events and skip handling the corresponding component interaction filters.
@arqunis arqunis merged commit 47a0a14 into serenity-rs:current Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builder Related to the `builder` module. client Related to the `client` module. collector Related to the `collector` module. enhancement An improvement to Serenity. model Related to the `model` module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants