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

support additional api for llonebot #113

Open
wants to merge 3 commits into
base: dev/main
Choose a base branch
from

Conversation

kukume
Copy link
Contributor

@kukume kukume commented Sep 10, 2024

支持llonebot的非onebot标准的api。

@ForliyScarlet
Copy link
Member

ForliyScarlet commented Sep 10, 2024

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 qodana-support@jetbrains.com

@ForteScarlet
Copy link
Member

首先感谢贡献,不过🤔我个人认为作为针对标准API的额外API扩展,它更适合以第三方扩展库的形式,不知是否有意向考虑将这提供的 llonebot 的 API (以及gocqhttp的API)以一种第三方的库发布呢?
我们会将这些第三方库展示于文档和README等地方,方便他人按需使用;如果组件内API有需要协助调整的(比如提交变更中的 OneBotForward )可以按需提供协助变更。

@@ -123,6 +125,8 @@ public class OneBotForwardNode private constructor(
@SerialName("user_id")
val userId: ID? = null,
val nickname: String? = null,
val name: String? = null,
val uin: ID? = null,
Copy link
Member

Choose a reason for hiding this comment

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

针对这俩额外添加的属性提供一些文档注释说明(比如它们是哪些平台所需要的)

Copy link
Contributor Author

@kukume kukume Sep 10, 2024

Choose a reason for hiding this comment

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

这是llonebot实现的cqhttp合并转发消息的两个属性,name和uin nickname和userId,意思是一样的,只是名字不同

Copy link
Member

Choose a reason for hiding this comment

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

这是llonebot实现的cqhttp合并转发消息的两个属性,name和uin nickname和userId,意思是一样的,只是名字不同

那么直接将它们作为普通属性而不是构造参数加在类中即可,并对应的 nickname 和 userId 初始化,这样可以确保 Data 的二进制兼容性,给这俩属性加个文档注释简单说一下它们是 llonebot 中的属性就好

@kukume
Copy link
Contributor Author

kukume commented Sep 10, 2024

首先感谢贡献,不过🤔我个人认为作为针对标准API的额外API扩展,它更适合以第三方扩展库的形式,不知是否有意向考虑将这提供的 llonebot 的 API (以及gocqhttp的API)以一种第三方的库发布呢? 我们会将这些第三方库展示于文档和README等地方,方便他人按需使用;如果组件内API有需要协助调整的(比如提交变更中的 OneBotForward )可以按需提供协助变更。

api的请求和返回数据结构都是一致的,并且也需要继承其OneBotApi,是需要第三方库引入带有OneBotApi的依赖吗?

@ForteScarlet
Copy link
Member

api的请求和返回数据结构都是一致的,并且也需要继承其OneBotApi,是需要第三方库引入带有OneBotApi的依赖吗?

嗯是这个意思。作为第三方库,引入组件库作为依赖并实现 OneBotApi 即可。似乎是应该没有需要使用到内部API的地方,作为一种可选的扩展库很合适的👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants