Mrs4s / go-cqhttp

cqhttp的golang实现,轻量、原生跨平台.
GNU Affero General Public License v3.0
10.39k stars 1.63k forks source link

[Bug]: 回复机器人消息的时候,找不到 oringin_message #1648

Closed leinlin closed 1 year ago

leinlin commented 2 years ago

请确保您已阅读以上注意事项,并勾选下方的确认框。

go-cqhttp 版本

v1.0.0-rc3

运行环境

Linux

运行架构

No response

连接方式

WebSocket (反向)

使用协议

3 | MacOS

重现步骤

可以拿到 回复机器消息中的机器消息

期望的结果是什么?

可以拿到 回复机器消息中的机器消息

实际的结果是什么?

拿到 回复机器消息中的机器消息为空报错

简单的复现代码/链接(可选)

if event.reply:
            for img in event.reply.message["image"]:
                users.append(UserInfo(img_url=str(img.data.get("url", ""))))

日志记录(可选)

No response

补充说明(可选)

No response

leinlin commented 2 years ago

File "/usr/local/lib/python3.9/dist-packages/nonebot/message.py", line 146, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "/usr/local/lib/python3.9/dist-packages/nonebot/message.py", line 196, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/matcher.py", line 668, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/matcher.py", line 635, in simple_run await handler( File "/usr/local/lib/python3.9/dist-packages/nonebot/dependencies/init.py", line 89, in call values = await self.solve(kwargs) File "/usr/local/lib/python3.9/dist-packages/nonebot/dependencies/init.py", line 191, in solve await param._solve(params) File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/params.py", line 155, in _solve solved = await task File "/usr/local/lib/python3.9/dist-packages/nonebot/utils.py", line 111, in _wrapper result = await loop.run_in_executor(None, pfunc) File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/root/ATRI/ATRI/plugins/nonebot_plugin_petpet/depends.py", line 72, in dependency raw_msg = event.original_message AttributeError: 'GroupMessageEvent' object has no attribute 'original_message'

OREOCODEDEV commented 2 years ago

该问题为NoneBot端插件或适配器造成的,并非go-cqhttp的问题,且我看见插件作者已经在你回复机器人的图片消息会报错的issue中回复解决方案

MingxuanGame commented 2 years ago

请更新 nonebot-adapter-onebot 到最新版本