-
-
Notifications
You must be signed in to change notification settings - Fork 5
nonstandard forward msg api #248
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
Conversation
… package for SendxxxForwardMsgApi
Qodana Community for JVMIt 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 Contact Qodana teamContact us at [email protected]
|
ForteScarlet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
首先感谢贡献🎉 需要修正一些小细节上的问题,然后尽量针对这两个API,对它们的功能进行更多测试(更多测试指不止「文本」消息,尽量多测试几个组合,比如图片和嵌套的和并转发等)。
测试不需要提交到PR的代码里,你本地能测通、然后说一声就行,可以提供测试用的代码,后续我给它们补充测试的时候可以用上。
然后记得确保 gradle apiCheck 和 gradle detekt 检测均可通过。稍后开启 workflow 的时候也会测,防止到时候有问题又要再改。
...e/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/api/SendPrivateMsgApi.kt
Show resolved
Hide resolved
...kotlin/love/forte/simbot/component/onebot/v11/core/api/nonstandard/SendGroupForwardMsgApi.kt
Show resolved
Hide resolved
...tlin/love/forte/simbot/component/onebot/v11/core/api/nonstandard/SendPrivateForwardMsgApi.kt
Show resolved
Hide resolved
...tlin/love/forte/simbot/component/onebot/v11/core/api/nonstandard/SendPrivateForwardMsgApi.kt
Show resolved
Hide resolved
...kotlin/love/forte/simbot/component/onebot/v11/core/api/nonstandard/SendGroupForwardMsgApi.kt
Outdated
Show resolved
Hide resolved
|
gradle 测试是能过的。我在我自己的应用中尝试了图片混合文本,图片混合文本加视频的组合。可以使用。 buildMessages {
+OneBotForwardNode.create(
userId = 114514.ID,
nickname = "user",
content = listOf(
OneBotImage.create(URI.create(url).toResource()),
OneBotText.create(
buildString {
append("textUnderImage")
}
)
)
).toElement()
+OneBotForwardNode.create(
userId = 114514.ID,
nickname = "user",
content = listOf(
OneBotVideo.create(video.toResource())
)
).toElement()
}但是貌似不能在OneBotForwardNode.create中再次嵌套一个OneBotForwardNode,转发时会直接无视掉。 buildMessages {
+OneBotForwardNode.create(
userId = 114514.ID,
nickname = "外层转发",
content = listOf(
OneBotText.create("外层消息内容"),
OneBotForwardNode.create(
userId = 114514.ID,
nickname = "内层转发",
content = listOf(
OneBotText.create("内层消息内容")
)
)
)
).toElement()
}我不知道我是不是写错了() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds non-standard forward message APIs to the OneBot v11 component, enabling the sending of forward messages in both private chats and group chats.
Key changes:
- Add support for non-standard forward message APIs (
send_private_forward_msgandsend_group_forward_msg) - Export the new nonstandard API package in the module definition
- Minor documentation format standardization for existing private message API
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| module-info.java | Exports the new nonstandard API package to make it available to other modules |
| SendPrivateForwardMsgApi.kt | Implements the non-standard API for sending private forward messages |
| SendGroupForwardMsgApi.kt | Implements the non-standard API for sending group forward messages with custom result type |
| SendPrivateMsgApi.kt | Updates documentation format to use backticks for consistency |
| OneBotFriend.kt | Removes trailing whitespace |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...kotlin/love/forte/simbot/component/onebot/v11/core/api/nonstandard/SendGroupForwardMsgApi.kt
Outdated
Show resolved
Hide resolved
...kotlin/love/forte/simbot/component/onebot/v11/core/api/nonstandard/SendGroupForwardMsgApi.kt
Show resolved
Hide resolved
|
这怎么还有个api( |
No description provided.