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

无法捕获send事件的session #21

Open
Container-Zero opened this issue Mar 9, 2024 · 5 comments
Open

无法捕获send事件的session #21

Container-Zero opened this issue Mar 9, 2024 · 5 comments

Comments

@Container-Zero
Copy link

Container-Zero commented Mar 9, 2024

QQNT版本:9.97-21484

LLOneBot版本:3.13.7

koishi版本:4.17.2(其它依赖保持最新)

koishi-plugin-adapter-onebot版本:6.5.0

调用管线:
Koishi->koishi-plugin-adapter-onebot->LLonebot->LiteLoaderQQNT->QQNT

执行下述代码:

export async function apply(ctx){
  ctx.on('send',async (session)=>{
    logger.info((session.content));
  })
}

console将输出undefined,而非本次bot所发送的内容

@Container-Zero
Copy link
Author

已确认是onebot流出现的错误

测试在其它依赖环境完全相同,替换onebot流为Red->Chronocat->QQNT,上述代码可以正常输出bot所发送的内容

@shigma
Copy link
Member

shigma commented Mar 26, 2024

Satori 无法保证 send 事件有 content,因为在你的情况下是上游(OneBot 标准)没有提供这个字段。

换用 Satori 协议此问题可以解决,因为 Chronocat 提供了。

@Container-Zero
Copy link
Author

Satori 无法保证 send 事件有 content,因为在你的情况下是上游(OneBot 标准)没有提供这个字段。

换用 Satori 协议此问题可以解决,因为 Chronocat 提供了。

也就说以遵循当前 OneBot 的标准来看,是不支持捕获 send 事件的 content 字段的对吗?

@shigma
Copy link
Member

shigma commented Mar 27, 2024

对的。如果你需要我可以补一个 polyfill 比如返回空串,或者手动拼一下,不过这不代表真实发送的消息。

@Container-Zero
Copy link
Author

对的。如果你需要我可以补一个 polyfill 比如返回空串,或者手动拼一下,不过这不代表真实发送的消息。

好的,麻烦你了~

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

No branches or pull requests

2 participants