Skip to content

Conversation

ForteScarlet
Copy link
Member

@ForteScarlet ForteScarlet commented Mar 23, 2025

OneBotImage.AdditionalParams, OneBotVideo.AdditionalParams, OneBotRecord.AdditionalParams 添加新的属性:base64Encoder: Base64Encoder 以支持提供一个具体的 Base64 编码器,并在默认未指定的情况下使用基于 Base64.Default 的编码器。

val image = OneBotImage.create(
                resource = resource,
                additional = OneBotImage.AdditionalParams().apply {
                    // 指定一个具体的编码器
                    base64Encoder = Base64Encoder.UrlSafe
                }
            )

Warning

在之前内部默认的编码器是 Base64.UrlSafe, 因此会产生与之前的不同行为。

close #188

@ForteScarlet ForteScarlet added the 缺陷 一个缺陷 label Mar 23, 2025
@ForteScarlet ForteScarlet self-assigned this Mar 23, 2025
@ForteScarlet ForteScarlet enabled auto-merge March 23, 2025 14:01
@ForliyScarlet
Copy link
Member

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@ForteScarlet ForteScarlet merged commit 32c0350 into dev/main Mar 23, 2025
4 checks passed
@ForteScarlet ForteScarlet deleted the dev/image-b64-188 branch March 23, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
缺陷 一个缺陷
Projects
None yet
Development

Successfully merging this pull request may close these issues.

考虑使用默认base64格式而不是urlsafe的编码来发送图片
2 participants