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

Add support for component data deserialization #231

Merged
merged 11 commits into from
Feb 18, 2025

Conversation

freya022
Copy link
Owner

@freya022 freya022 commented Feb 16, 2025

This enables you to pass any data to your component and timeout handlers, as long as they are serializable.

Any serialization library can be used, Jackson, Gson, kotlinx.serialization, Protobuf, Java's serialization (???), you name it.

These changes should be compatible with existing data, if it isn't, please report the bug.

Breaking changes

  • The String arg parameter have been replaced with a data argument of type SerializedComponentData
  • A SerializedComponentData serialize(R) method has been added
  • A new migration script has been added, if you are using a migration tool already, you do not need to do anything

New features

  • Added @SerializableComponentData and @SerializableTimeoutData
    • Can be used instead of @ComponentData/@TimeoutData to (de)serialize objects using GlobalComponentDataSerializer
    • GlobalComponentDataSerializer has a default instance, which can be overridden by creating your own instance.

@freya022 freya022 added type: breaking Contains a backwards incompatible change type: feature V3 Targets BotCommands 3.x.x labels Feb 16, 2025
@freya022 freya022 added this to the v3.0 milestone Feb 16, 2025
@freya022 freya022 marked this pull request as ready for review February 17, 2025 17:09
Copy link

@Sanduhr32 Sanduhr32 left a comment

Choose a reason for hiding this comment

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

Fuck yeah 👍🏼

@freya022
Copy link
Owner Author

Appreciate but this seems to be a large "LTGM" typo

Autocorrect these days, you know

@freya022 freya022 merged commit 2950815 into 3.X Feb 18, 2025
2 checks passed
@freya022 freya022 deleted the feature/component-data-deserialization branch February 18, 2025 14:46
@Sanduhr32
Copy link

Enthusiasm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: breaking Contains a backwards incompatible change type: feature V3 Targets BotCommands 3.x.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants