Conversation
|
需要测试一下获取聊天记录里的图片,视频这类文件正不正常 |
|
测试了一下 get_image 提示错误 应该是读取数据格式问题 我研究下怎么修复 |
|
我研究了一下 好像之前的版本 get_image 就有问题吧 Lines 536 to 540 in ae92e97 读取的数据结构 Lines 1143 to 1149 in ae92e97 然后我试了下 2.0.0.beta.5 会直接G |
|
根据旧版 go-cqhttp 的相关代码 |
|
视频相关代码 经检查 data := binary.NewBuilder().
WriteBool(source.SourceType == message.SourceGroup).
WriteBytes(i.Md5).
WriteBytes(i.Sha1).
WritePacketString(i.Name, "u32", true).
WritePacketString(i.UUID, "u32", true).
WriteU32(uint32(source.PrimaryID)).
ToBytes()读取部分 r := binary.NewReader(b)
isGroup := r.ReadU8() == '1'
video := &message.ShortVideoElement{ // todo 检查缓存是否有效
Md5: r.ReadBytes(16),
Sha1: r.ReadBytes(20),
Name: r.ReadStringWithLength("u32", true),
UUID: r.ReadStringWithLength("u32", true),
}
target := r.ReadU32()顺序匹配 格式匹配 应该没问题 |
|
消息撤回接口正常 消息保存应该是正常的 |
|
获取聊天记录接口 [2025-10-21 15:31:20] [WARNING]: 获取 0 成员信息失败,尝试刷新成员列表
2025/10/21 15:31:20 http: panic serving 127.0.0.1:60340: runtime error: invalid memory address or nil pointer dereference
goroutine 365 [running]:
net/http.(*conn).serve.func1()
net/http/server.go:1947 +0xbe
panic({0x9946e0?, 0xee3810?})
runtime/panic.go:792 +0x132
github.com/Mrs4s/go-cqhttp/coolq.(*CQBot).CQGetGroupMessageHistory(0xc00044ed80, 0x2e0d0f0a, 0x2b96)
github.com/Mrs4s/go-cqhttp/coolq/api.go:1321 +0x7df
github.com/Mrs4s/go-cqhttp/modules/api.(*Caller).call(0xc000020080, {0xc000024336, 0x15?}, 0xeea6e0, {0xb40c60, 0xc00061a3c0})
github.com/Mrs4s/go-cqhttp/modules/api/api.go:175 +0x7da7
github.com/Mrs4s/go-cqhttp/modules/api.(*Caller).Call(0xc000020080, {0xc000024336, 0x15}, 0xeea6e0, {0xb40c60, 0xc00061a3c0})
github.com/Mrs4s/go-cqhttp/modules/api/caller.go:35 +0xb3
github.com/Mrs4s/go-cqhttp/server.(*httpServer).ServeHTTP(0xc000020060, {0xb44f10, 0xc00048c0e0}, 0xc0003b63c0)
github.com/Mrs4s/go-cqhttp/server/http.go:213 +0x665
net/http.serverHandler.ServeHTTP({0xb43038?}, {0xb44f10?, 0xc00048c0e0?}, 0x1?)
net/http/server.go:3301 +0x8e
net/http.(*conn).serve(0xc00028a900, {0xb45810, 0xc0002f0cc0})
net/http/server.go:2102 +0x625
created by net/http.(*Server).Serve in goroutine 85
net/http/server.go:3454 +0x485 |
这个感觉像是lagrangego的问题,先不管他 |
|
排查了一下 应该是消息被撤回之后导致的问题 |
|
设置群禁言接口 根据代码逻辑 应该是 LagrangeGo 返回的失败 |
|
群公告 |
|
删除群文件接口 但是实际实现获取的是 |
|
大部分接口都测试过了 看起来没太大问题 |
已编译通过 登录 发送消息 接收消息等基础功能已测试