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

增加部分基于文件系统的 Resource、Image API 的实验性支持 #955

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

ForliyScarlet
Copy link
Member

@ForliyScarlet ForliyScarlet commented Oct 14, 2024

Resource:

val resource = fileResource("/path/file.txt")
val resource1 = fileResource("path", "file.txt")
// JVM: Resources.valueOfFilePath(...)

Image:

import love.forte.simbot.message.OfflineImage.fileOfflineImage

val fileImage = fileOfflineImage("/path/img.png")
val fileImage1 = fileOfflineImage("path", "img.png")
// JVM: OfflineImage.ofFilePath

内部基于 kotlinx-io, 由于其尚未1.0,因此暂不对外暴露任何 kotlinx.io (除了两个标记了实验性API的 Resource 的扩展接口)

see also: #950

@ForliyScarlet ForliyScarlet added the 特性 一个新特性,或者一个新的功能/能力 label Oct 14, 2024
@ForteScarlet ForteScarlet merged commit 66a8c84 into v4-dev Oct 14, 2024
5 of 6 checks passed
@ForteScarlet ForteScarlet deleted the support-ktx-io branch October 14, 2024 15:15
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.

2 participants