报告清单
影响版本
nonebot: 2.0.0rc2; nonebot_plugin_gocqhttp: v1.0.0-rc3; 插件最新版;
问题描述
在发送命令“/摸鱼”之后,插件能获取摸鱼人日历图片链接(moyu_img),但是gocq图片上传失败,报错image type error: application/octet-stream,最终导致群消息发送失败:消息为空
日志如下:
12-22 22:59:32 [INFO] nonebot_plugin_gocqhttp | [3154035878] 收到群 猫娘的温暖小窝(995676811) 内 可爱阿福rua白猫(2364934266) 的消息: /摸鱼 (-555706903)
12-22 22:59:32 [SUCCESS] nonebot | OneBot V11 3154035878 | [message.group.normal]: Message -555706903 from 2364934266@[群:995676811] "/摸鱼"
12-22 22:59:32 [INFO] nonebot | Event will be handled by Matcher(type='message', module=src.plugins.nonebot_plugin_moyu)
https://api.j4u.ink/proxy/redirect/moyu/calendar/20221222.png
12-22 22:59:32 [WARNING] nonebot_plugin_gocqhttp | [3154035878] 警告: 群 995676811 图片上传失败: image type error: application/octet-stream
12-22 22:59:32 [WARNING] nonebot_plugin_gocqhttp | [3154035878] 群消息发送失败: 消息为空.
12-22 22:59:32 [INFO] nonebot | Matcher(type='message', module=src.plugins.nonebot_plugin_moyu) running complete
12-22 22:59:32 [ERROR] nonebot | Running Matcher(type='message', module=src.plugins.nonebot_plugin_moyu) failed.
Traceback (most recent call last):
File "e:\code\code_study_project\QQRobot\AstolfoCatV4.0\bot.py", line 50, in
nonebot.run(app="mp_main:app")
File "D:\Python\lib\site-packages\nonebot_init_.py", line 273, in run
get_driver().run(*args, **kwargs)
File "D:\Python\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run
uvicorn.run(
File "D:\Python\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "D:\Python\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "D:\Python\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\Python\lib\asyncio\base_events.py", line 629, in run_until_complete
self.run_forever()
File "D:\Python\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()
File "D:\Python\lib\asyncio\base_events.py", line 596, in run_forever
self._run_once()
File "D:\Python\lib\asyncio\base_events.py", line 1890, in _run_once
handle._run()
File "D:\Python\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\Python\lib\site-packages\nonebot\message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
File "D:\Python\lib\site-packages\nonebot\message.py", line 188, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 702, in simple_run
await handler(
File "D:\Python\lib\site-packages\nonebot\dependencies_init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "e:\code\code_study_project\QQRobot\AstolfoCatV4.0\src\plugins\nonebot_plugin_moyu_init_.py", line 106, in moyu
await matcher.finish(MessageSegment.image(moyu_img))
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 476, in finish
await cls.send(message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 461, in send
return await bot.send(event=event, message=_message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 220, in send
return await self.class.send_handler(self, event, message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 174, in send
return await bot.send_msg(**params)
File "D:\Python\lib\site-packages\nonebot\internal\adapter\bot.py", line 120, in call_api
raise exception
File "D:\Python\lib\site-packages\nonebot\internal\adapter\bot.py", line 98, in call_api
result = await self.adapter._call_api(self, api, **data)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\adapter.py", line 132, in _call_api
raise ActionFailed(**result)
nonebot.adapters.onebot.v11.exception.ActionFailed
复现步骤
- 下载并将插件安装在bot上,Succeeded to import "src.plugins.nonebot_plugin_moyu"
- 在群聊中发送命令“/摸鱼”。
- 出现问题描述当中的报错。
预期行为
正常情况下应该响应命令"/摸鱼",发送摸鱼日历链接返回的图片。
实际行为
实际上bot无任何回复,并出现问题描述那样的报错。
日志信息
12-22 22:59:32 [INFO] nonebot_plugin_gocqhttp | [3154035878] 收到群 猫娘的温暖小窝(995676811) 内 可爱阿福rua白猫(2364934266) 的消息: /摸鱼 (-555706903)
12-22 22:59:32 [SUCCESS] nonebot | OneBot V11 3154035878 | [message.group.normal]: Message -555706903 from 2364934266@[群:995676811] "/摸鱼"
12-22 22:59:32 [INFO] nonebot | Event will be handled by Matcher(type='message', module=src.plugins.nonebot_plugin_moyu)
https://api.j4u.ink/proxy/redirect/moyu/calendar/20221222.png
12-22 22:59:32 [WARNING] nonebot_plugin_gocqhttp | [3154035878] 警告: 群 995676811 图片上传失败: image type error: application/octet-stream
12-22 22:59:32 [WARNING] nonebot_plugin_gocqhttp | [3154035878] 群消息发送失败: 消息为空.
12-22 22:59:32 [INFO] nonebot | Matcher(type='message', module=src.plugins.nonebot_plugin_moyu) running complete
12-22 22:59:32 [ERROR] nonebot | Running Matcher(type='message', module=src.plugins.nonebot_plugin_moyu) failed.
Traceback (most recent call last):
File "e:\code\code_study_project\QQRobot\AstolfoCatV4.0\bot.py", line 50, in
nonebot.run(app="mp_main:app")
File "D:\Python\lib\site-packages\nonebot_init_.py", line 273, in run
get_driver().run(*args, **kwargs)
File "D:\Python\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run
uvicorn.run(
File "D:\Python\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "D:\Python\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "D:\Python\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\Python\lib\asyncio\base_events.py", line 629, in run_until_complete
self.run_forever()
File "D:\Python\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()
File "D:\Python\lib\asyncio\base_events.py", line 596, in run_forever
self._run_once()
File "D:\Python\lib\asyncio\base_events.py", line 1890, in _run_once
handle._run()
File "D:\Python\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\Python\lib\site-packages\nonebot\message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
File "D:\Python\lib\site-packages\nonebot\message.py", line 188, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 702, in simple_run
await handler(
File "D:\Python\lib\site-packages\nonebot\dependencies_init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "e:\code\code_study_project\QQRobot\AstolfoCatV4.0\src\plugins\nonebot_plugin_moyu_init_.py", line 106, in moyu
await matcher.finish(MessageSegment.image(moyu_img))
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 476, in finish
await cls.send(message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 461, in send
return await bot.send(event=event, message=_message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 220, in send
return await self.class.send_handler(self, event, message, **kwargs)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\bot.py", line 174, in send
return await bot.send_msg(**params)
File "D:\Python\lib\site-packages\nonebot\internal\adapter\bot.py", line 120, in call_api
raise exception
File "D:\Python\lib\site-packages\nonebot\internal\adapter\bot.py", line 98, in call_api
result = await self.adapter._call_api(self, api, **data)
File "D:\Python\lib\site-packages\nonebot\adapters\onebot\v11\adapter.py", line 132, in _call_api
raise ActionFailed(**result)
nonebot.adapters.onebot.v11.exception.ActionFailed
额外补充
No response