Skip to content

feat(util): add InteractionResponse builders#2506

Merged
HTGAzureX1212 merged 3 commits intomainfrom
vilgotf/interaction-response-builder
Mar 3, 2026
Merged

feat(util): add InteractionResponse builders#2506
HTGAzureX1212 merged 3 commits intomainfrom
vilgotf/interaction-response-builder

Conversation

@vilgotf
Copy link
Member

@vilgotf vilgotf commented Jan 6, 2026

The InteractionResponseDataBuilder has little utility because:

  1. InteractionResponseData implements Default, so the ..Default::default() syntax is already available
  2. It is unable to restrict fields for a InteractionResponseType variant

This PR therefore replaces InteractionResponseDataBuilder with 4 new builders: AutocompleteBuilder, ChannelMessageBuilder, ModalBuilder, and UpdateMessageBuilder.

@github-actions github-actions bot added c-util Affects the util crate m-breaking change Breaks the public API. t-feature Addition of a new feature labels Jan 6, 2026
@vilgotf vilgotf force-pushed the vilgotf/interaction-response-builder branch from 48db657 to 3820195 Compare January 6, 2026 09:27
@vilgotf vilgotf changed the base branch from main to next January 6, 2026 09:28
@github-actions github-actions bot added c-gateway Affects the gateway crate c-http Affects the http crate c-http-ratelimiting Affects the http ratelimiting crate c-model Affects the model crate labels Jan 6, 2026
@vilgotf vilgotf force-pushed the vilgotf/interaction-response-builder branch from 3820195 to 3af823f Compare January 6, 2026 09:33
@github-actions github-actions bot removed c-model Affects the model crate c-http-ratelimiting Affects the http ratelimiting crate c-gateway Affects the gateway crate c-http Affects the http crate labels Jan 6, 2026
@vilgotf
Copy link
Member Author

vilgotf commented Jan 6, 2026

Note: I've never used modals, so please double check UpdateMessageBuilder.

@vilgotf vilgotf force-pushed the vilgotf/interaction-response-builder branch from 3af823f to 375de5c Compare January 6, 2026 11:27
@github-actions github-actions bot added c-book Affects the book c-http Affects the http crate labels Jan 6, 2026
@vilgotf vilgotf changed the base branch from next to main January 6, 2026 11:27
@vilgotf vilgotf changed the title feat(util)!: improve InteractionResponse builders feat(util): add InteractionResponse builders Jan 6, 2026
@vilgotf vilgotf removed the m-breaking change Breaks the public API. label Jan 6, 2026
@vilgotf vilgotf force-pushed the vilgotf/interaction-response-builder branch from 375de5c to c594878 Compare January 6, 2026 11:31
The `InteractionResponseDataBuilder` has little utility because:

1. `InteractionResponseData` implements `Default`, so the
   `..Default::default()` syntax is already available
2. It is unable to restrict fields for a `InteractionResponseType`
   variant

This PR therefore deprecates and replaces
`InteractionResponseDataBuilder` with 4 new builders:
`AutocompleteBuilder`, `ChannelMessageBuilder`, `ModalBuilder`, and
`UpdateMessageBuilder`.
@vilgotf vilgotf force-pushed the vilgotf/interaction-response-builder branch from c594878 to 9334058 Compare January 6, 2026 11:35
Copy link
Member

@Erk- Erk- 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

@HTGAzureX1212 HTGAzureX1212 merged commit 0bb50d2 into main Mar 3, 2026
9 checks passed
@HTGAzureX1212 HTGAzureX1212 deleted the vilgotf/interaction-response-builder branch March 3, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c-book Affects the book c-http Affects the http crate c-util Affects the util crate t-feature Addition of a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants