Skip to content

Conversation

@valzargaming
Copy link
Member

This pull request refactors the MessageBuilder class to improve component handling and clarify type annotations, while deprecating an older method in favor of a more flexible approach. The most important changes are outlined below:

Component Handling Improvements

  • Updated the addComponent method to accept multiple components at once using variadic parameters, and improved its type annotations to support collections and arrays of ComponentObject. The method now iterates over all provided components and processes them accordingly. [1] [2]
  • Deprecated the addComponents method in favor of the updated addComponent method, and refactored its implementation to use the new variadic approach.

Type Annotation and Consistency Updates

  • Improved type annotations for sticker-related methods, specifying that stickers can be either Sticker objects or strings, and that arrays must explicitly contain Sticker[] or string[]. [1] [2]
  • Fixed a bug in countTotalComponents by ensuring it operates on the array representation of the components collection, preventing potential errors when components are not set.

@valzargaming valzargaming requested a review from a team November 17, 2025 20:50
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.

2 participants