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

[BUG] 向 单向好友 发送消息超时 #72

Closed
hiiragiyuriko opened this issue Jun 16, 2024 · 12 comments
Closed

[BUG] 向 单向好友 发送消息超时 #72

hiiragiyuriko opened this issue Jun 16, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@hiiragiyuriko
Copy link

系统版本

Arch Linux - Docker 26.0.0

QQNT 版本

3.2.9-240606

NapCat 版本

1.5.7

OneBot 客户端

使用 HTTP 服务 curl 手工请求

发生了什么?

在 NapCat 中无法调用 send_private_msg 向单向好友发送消息,log 提示 “发生错误 发送超时”。

如何复现

  1. 首先确保两个账号没有任何共同群聊。
  2. 设置 NapCat 登陆的机器人账号 (A) 加好友验证方式为 “需正确回答问题”。
  3. 使用另一个账号 (B) 添加机器人 (A) 为好友,机器人账号 (A) 不对好友请求进行处理。(此时机器人账号 (A) 是该账号 (B) 的单向好友)
  4. 在官方 NTQQ 客户端中登录机器人账号 (A) ,可以对 B 账号发送消息。
  5. 使用 NapCat 调用 send_private_msg 方法向 B 账号发送消息,提示 “发生错误 发送超时“。
  6. 机器人账号 (A) 通过 B 的好友请求,再次使用 NapCat 调用 send_private_msg 方法向 B 账号发送消息,可以成功发送。

期望的结果?

NapCat 向单向好友正确发送消息

NapCat 运行日志

2024-06-16 06:48:01 [INFO] Hiirakai(3248xxxxxx) | 发送消息 给私聊 3058xxxxxx: hello 
2024-06-16 06:48:06 [ERROR] Hiirakai(3248xxxxxx) | 发生错误 发送超时

OneBot 客户端运行日志

curl -v 'http://127.0.0.1:9293/send_private_msg?user_id=3058xxxxxx&message=hello'
*   Trying 127.0.0.1:9293...
* Connected to 127.0.0.1 (127.0.0.1) port 9293 (#0)
> GET /send_private_msg?user_id=3058xxxxxx&message=hello HTTP/1.1
> Host: 127.0.0.1:9293
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Access-Control-Allow-Origin: *
< Content-Type: application/json; charset=utf-8
< Content-Length: 107
< ETag: W/"6b-vPIUZ7fIo9FVAE17zgLZ7Qgxpf8"
< Date: Sun, 16 Jun 2024 06:48:06 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5
< 
* Connection #0 to host 127.0.0.1 left intact
{"status":"failed","retcode":200,"data":null,"message":"发送超时","wording":"发送超时","echo":null}
@hiiragiyuriko hiiragiyuriko added the bug Something isn't working label Jun 16, 2024
@MliKiowa
Copy link
Member

单向好友可能是由于isbuddy函数判断为非好友 chattype异常 导致的异常 但是我没有单向好友 不太好测试

@MliKiowa
Copy link
Member

看了下你的思路 我感觉有共同群聊的没有被动临时没有问题

@airdm
Copy link

airdm commented Jun 21, 2024

看了下你的思路 我感觉有共同群聊的没有被动临时没有问题

我也有同样的问题,BOT设置了 允许任何人添加为好友时 客户添加bot后都是单向的,发送消息就会触发"发生错误 发送超时" 然而在客户的界面显示两人已经是好友状态. 用QQNT登录BOT时会发现,和客户的聊天窗口显示的临时会话.
这个问题在以前的版本中没有出现,最近更新后才出现的.

@MliKiowa
Copy link
Member

晚点复现试试

@MliKiowa
Copy link
Member

下个版本一定修

@Blues-star
Copy link

我这边也遇到了,但是是普通好友也会出现这个问题,理论上应该不是临时好友才有的,我这边的现象是群聊可以发送消息,但是私聊不行

@mhcms
Copy link

mhcms commented Jul 8, 2024

Docker 最新 NapCat 版本1.6.3,还有这个问题,机器人加好友验证方式为:允许任何人,实际加的是单项好友,私聊发消息超时,手动同意好友后能正常私聊。隔壁Lagrange没这个问题

@airdm
Copy link

airdm commented Jul 17, 2024

今天又遇到这个私聊没反应的问题 但是没显示发送错误,多了个报错,不清楚是不是同一个问题.
TypeError: Cannot read properties of undefined (reading 'toString')
at OB11HTTPServer.handleFailed (file:///E:/QQNT/resources/app/app_launcher/napcat/napcat.mjs:30477:41)
at file:///E:/QQNT/resources/app/app_launcher/napcat/napcat.mjs:27097:14

@SolitaryJune
Copy link

确实有这样的问题
2024-07-31 21:37:21 [INFO] 111() | 退下(): 加22
2024-07-31 21:37:37 [ERROR] 111() | 发生错误 Error: Timeout: NTEvent EventName:NodeIKernelMsgService/sendMsg ListenerName:NodeIKernelMsgListener/onMsgInfoListUpdate EventRet:
{
"result": 1,
"errMsg": ""
}

at Timeout.databack [as _onTimeout] (file:///usr/src/app/napcat/napcat.mjs:9669:18)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7) 

@W1ndys
Copy link

W1ndys commented Aug 3, 2024

问题加1,群聊单向好友会报这个错误,并且读不到QQ号,读到的QQ是0

image

 TypeError: Cannot read properties of undefined (reading 'toString')
    at getGroupMember (file:///usr/src/app/napcat/napcat.mjs:9980:21)
    at logMessage (file:///usr/src/app/napcat/napcat.mjs:27433:35)
    at file:///usr/src/app/napcat/napcat.mjs:27673:11 
2024-08-04 01:11:39 [INFO] 命运之轮-匿名骰子(20xxx392) | 。(0): xxxxxxx
2024-08-04 01:11:39 [ERROR] 命运之轮-匿名骰子(202xxxxx92) | 发生错误 请指定 group_id 或 user_id 

@uosbox
Copy link

uosbox commented Aug 4, 2024

看了下你的思路 我感觉有共同群聊的没有被动临时没有问题

相同群里也没法发群私聊,即便有管理员权限也不行 ,针状和楼主一样

比如
有一个群 AAA
张三和李四都加入了AAA群里
张三是管理员
张三用napcat登录
然后点调用api接口send_private_msg给李四发送消息 会超时报错
image

@MliKiowa
Copy link
Member

MliKiowa commented Aug 6, 2024

过于久远了 仍然有需要请入群调试

@MliKiowa MliKiowa closed this as completed Aug 6, 2024
@MliKiowa MliKiowa closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants