-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
Bug: middleware处理时不应武断selfId === userId时返回 #1403
Comments
人机一体会造成严重的递归问题,Koishi v3 时代有不少使用者因为此问题导致机器人无限发送消息并最终被平台限流。Koishi 目前暂不支持人机一体。 |
问题不是人机一体,而是同一个账号在别的客户端发送的信息无法被koishi处理。即使会产生递归问题,加一个可选择开关也比直接return强,现在的实现导致一些功能从根本上无法实现。 |
「人机一体」的定义就是「同一个账号在别的客户端发送的信息被 Bot 处理」啊。 加开关我觉得是可以的,等等看其他人的意见。不过除了递归问题以外,人机一体还会遇到其他许多问题,例如权限判断和消息统计等等问题。允许人机一体会导致现有的不少插件行为出现变化。 |
可以说说你的需求。如果合理的话可以加开关。 |
需要做消息日志,包括机器人发送的消息也需要存起来,并且日志和实际业务不在同一台机器,不使用同一套代码 |
那你应当使用 message 事件而非 middleware。 middleware 会被截断,就算不考虑是否是自身消息也不应该使用。
|
Describe the bug
在别的客户端发送消息时,该消息无法被koishi插件处理,这是不应该的
Steps to reproduce
koishi/packages/core/src/middleware.ts
Line 238 in e496ddb
Expected behavior
这个判断删了,或者加个开关
Screenshots
No response
Versions
平台无关
Additional context
No response
The text was updated successfully, but these errors were encountered: