Skip to content

Conversation

@arqunis
Copy link
Member

@arqunis arqunis commented Jul 12, 2025

Previously, users were able to create the base64-encoded blob of data via CreateAttachment::to_base64, which returned a string. On next, this method had been replaced by encode, which returns an ImageData instead.

It is still the base64-encoded blob of data as before, but users were no longer able to access it directly. This wasn't too much of a problem, as many places that accepted a plain string switched to expecting ImageData. So for users, nothing practically has changed. Except GuildId::create_emoji, which still wanted a string, yet users couldn't reuse any ImageData they might have already had.

This rectifies the issue by not only switching image: &str to image: ImageData in GuildId::create_emoji, but also adding an accessor method for the blob of data in ImageData.

@arqunis arqunis added enhancement An improvement to Serenity. breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users labels Jul 12, 2025
@github-actions github-actions bot added model Related to the `model` module. builder Related to the `builder` module. labels Jul 12, 2025
@arqunis arqunis merged commit 8f8d63d into serenity-rs:next Jul 13, 2025
24 checks passed
@arqunis arqunis deleted the image_data branch July 13, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users builder Related to the `builder` 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.

2 participants