bot-ssttkkl / nonebot-plugin-pixivbot

NoneBot插件,发送随机Pixiv插画、画师更新推送、定时订阅推送……

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

点图时报错:内部错误:<class 'TypeError'>AggregatedMessageFactory.send() got an unexpected keyword argument 'reply'

salspica opened this issue · comments

pixivbot版本:v2.0.3
适配器:onebot.v11
运行环境:winserver2012r2
python:3.11.4

使用点图相关指令(来张图\来张XX的图\来张XX老师的图)时产生报错:

09-03 10:22:09 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_recommended
illust) running complete
09-03 10:22:09 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_re
commended_illust) failed.
Traceback (most recent call last):
File "C:\Users\Administrator\NBbBOT\bot.py", line 18, in
nonebot.run()
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_init
.py", line 333, in run
get_driver().run(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 199, in run
uvicorn.run(
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\uvicorn\main.py", line 587, in run
server.run()
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_unt
il_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run

forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_for
ever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1922, in _run_o
nce
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\message.py", line 467, in check_and_run_matcher
await _run_matcher(

File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\message.py", line 419, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 759, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 734, in simple

run
await handler(
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\dependencies_init_.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\common\random_recommended_
illust.py", line 39, in _
await RandomRecommendedIllustHandler(session, event).handle(count=count)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\base.py", line 111, in han
dle
await self.interceptor.intercept(self, self.parse_args_and_actual_handle, *args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\combined_inter
ceptor.py", line 54, in intercept
await self.x.intercept(
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\combined_inter
ceptor.py", line 54, in intercept
await self.x.intercept(
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\combined_inter
ceptor.py", line 54, in intercept
await self.x.intercept(
[Previous line repeated 2 more times]
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\service_interc
eptor.py", line 34, in intercept
await wrapped_func(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\default_error

interceptor.py", line 43, in intercept
await wrapped_func(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\timeout_interc
eptor.py", line 17, in intercept
await wait_for(wrapped_func(*args, **kwargs),
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\tasks.py", line 479, in wait_for
return fut.result()
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\loading_prompt
_interceptor.py", line 24, in intercept
await wrapped_func(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\retry_intercep
tor.py", line 28, in intercept
raise e
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\retry_intercep
tor.py", line 23, in intercept
return await wrapped_func(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\record_req_int
erceptor.py", line 16, in intercept
await wrapped_func(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\base.py", line 124, in pa
rse_args_and_actual_handle
await self.actual_handle(**kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\common\random_recommended

illust.py", line 31, in actual_handle
await self.post_illusts(illusts,
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\base.py", line 223, in pos
t_illusts
await self.post_illust(illusts[0], header=header, number=number)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\base.py", line 217, in pos
t_illust
await context.require(Postman).post_illusts(model, self.session, self.event)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\recorder.py", line 77, in
post_illusts
await self.delegation.post_illusts(model, session, event)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\service\postman.py", line 106, in
post_illusts
await self._post(msg, session, event)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\service\postman.py", line 72, in _
post
await msg.send(reply=True)

TypeError: AggregatedMessageFactory.send() got an unexpected keyword argument 'reply'

还注意到加载插件时会报错:
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\importlib_init_.py", line 126, in import_m
odule
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'nonebot_plugin_gocqhttp_cross_machine_upload_file'

但插件能正常启动,不知道有没有影响

以及用一些关键词点图(如 来张ブルーアーカイブ的图)时报错:
内部错误:<class 'ssttkkl_nonebot_utils.errors.errors.QueryError'>别看了,没有的。

日志:
09-03 10:47:35 [SUCCESS] nonebot | OneBot V11 3187539714 | [message.private.friend]: Message -1012990545 from 2648571809
'来张ブルーアーカイブ的图'
09-03 10:47:35 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_pixivbot.handler.
common.random_illust)
09-03 10:47:35 [INFO] nonebot_plugin_pixivbot | [search_illust] no cache (word=ブルーアーカイブ的)
09-03 10:47:35 [INFO] nonebot_plugin_pixivbot | [remote] loading page 0
09-03 10:47:36 [INFO] nonebot_plugin_pixivbot | [remote] got 0 illusts, illust_detail of 0 are missed
09-03 10:47:36 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_illust) run
ning complete
09-03 10:47:36 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_pixivbot.handler.common.random_il
lust) failed.
Traceback (most recent call last):
File "C:\Users\Administrator\NBbBOT\bot.py", line 18, in
nonebot.run()
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_init_.py", line 333, in run
get_driver().run(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 199, in run
uvicorn.run(
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\uvicorn\main.py", line 587, in run
server.run()
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_unt
il_complete
self.run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run

forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_for
ever
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1922, in _run_o
nce
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\message.py", line 467, in check_and_run_matcher
await _run_matcher(

File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\message.py", line 419, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 759, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 734, in simple

run
await handler(
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot\dependencies_init_.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\common\random_illust.py",
line 49, in _
await RandomIllustHandler(session, event).handle(word, count=count)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\base.py", line 111, in han
dle
await self.interceptor.intercept(self, self.parse_args_and_actual_handle, *args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\combined_inter
ceptor.py", line 54, in intercept
await self.x.intercept(
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\combined_inter
ceptor.py", line 54, in intercept
await self.x.intercept(
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\combined_inter
ceptor.py", line 54, in intercept
await self.x.intercept(
[Previous line repeated 2 more times]
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\service_interc
eptor.py", line 34, in intercept
await wrapped_func(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\default_error

interceptor.py", line 43, in intercept
await wrapped_func(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\timeout_interc
eptor.py", line 17, in intercept
await wait_for(wrapped_func(*args, **kwargs),
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\tasks.py", line 479, in wait_for
return fut.result()
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\loading_prompt
_interceptor.py", line 24, in intercept
await wrapped_func(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\retry_intercep
tor.py", line 28, in intercept
raise e
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\retry_intercep
tor.py", line 23, in intercept
return await wrapped_func(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\interceptor\record_req_int
erceptor.py", line 16, in intercept
await wrapped_func(*args, **kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\base.py", line 124, in _pa
rse_args_and_actual_handle
await self.actual_handle(**kwargs)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\handler\common\random_illust.py",
line 35, in actual_handle
illusts = await service.random_illust(word, count=count,
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\service\pixiv_service.py", line 85
, in random_illust
return await self._choice_and_load(list(illusts), conf.pixiv_random_illust_method, count)
File "C:\Users\Administrator\NBbBOT.venv\Lib\site-packages\nonebot_plugin_pixivbot\service\pixiv_service.py", line 48
, in _choice_and_load
raise QueryError("别看了,没有的。")
ssttkkl_nonebot_utils.errors.errors.QueryError: 别看了,没有的。

以上两种报错均无法百分百复现,现在bot处于一个有时候能点图有时候报错的玄学状态。_(´ཀ`」∠)_差不多八成的时候是报错吧。

2.0.4已修复

还注意到加载插件时会报错: File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\importlib__init__.py", line 126, in import_m odule return _bootstrap._gcd_import(name[level:], package, level) File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1140, in _find_and_load_unlocked ModuleNotFoundError: No module named 'nonebot_plugin_gocqhttp_cross_machine_upload_file'

但插件能正常启动,不知道有没有影响

这个无影响

感谢,更新插件后实测问题已解决。
您!