CMHopeSunshine / LittlePaimon

小派蒙!基于Nonebot2的原神机器人,包括但不限于UID面板查询、抽卡记录分析、游戏攻略图鉴、实时便签、原石札记、群聊学习、群管等功能。/ LittlePamon! Genshin Impact multifunctional bot based on Nonebot2.
https://docs.paimon.cherishmoon.top
GNU Affero General Public License v3.0
1.15k stars 130 forks source link

[问题]重启指令错误 #390

Closed YouYouLip closed 1 year ago

YouYouLip commented 1 year ago

02-14 22:40:45 [ERROR] nonebot | Running Matcher(type='message', module=LittlePaimon.plugins.bot_manager) failed. Traceback (most recent call last): File "D:\NoneBot-LittlePaimo\bot.py", line 37, in nonebot.run(app="mp_main__:app", access_log=False) File "D:\NoneBot-LittlePaimo.venv\lib\site-packages\nonebot\init__.py", line 273, in run get_driver().run(*args, *kwargs) File "D:\NoneBot-LittlePaimo.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run uvicorn.run( File "D:\NoneBot-LittlePaimo.venv\lib\site-packages\uvicorn\main.py", line 569, in run server.run() File "D:\NoneBot-LittlePaimo.venv\lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Program Files\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete self.run_forever() File "C:\Program Files\Python310\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 603, in run_forever self._run_once() File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 1906, in _run_once handle._run() File "C:\Program Files\Python310\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "D:\NoneBot-LittlePaimo.venv\lib\site-packages\nonebot\message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "D:\NoneBot-LittlePaimo.venv\lib\site-packages\nonebot\message.py", line 188, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "D:\NoneBot-LittlePaimo.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 727, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "D:\NoneBot-LittlePaimo.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 702, in simple_run await handler( File "D:\NoneBot-LittlePaimo.venv\lib\site-packages\nonebot\dependencies__init.py", line 108, in call__ return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "D:\NoneBot-LittlePaimo\LittlePaimon\plugins\botmanager__init__.py", line 141, in await get_app().router.shutdown() File "D:\NoneBot-LittlePaimo.venv\lib\site-packages\starlette\routing.py", line 658, in shutdown await handler() TypeError: Chatbot.playwright_close() missing 1 required positional argument: 'self' 重启指令运行后出现错误并不会让bot停止工作 而是终止了重启指令 不管是nb paimon run还是poetry run nb run都会这样

CMHopeSunshine commented 1 year ago

https://github.com/A-kirami/nonebot-plugin-chatgpt/blob/3bb4e6e98e541a9af0dc25acee83f515702a592d/nonebot_plugin_chatgpt/chatgpt.py#L80

该插件不兼容导致的问题

YouYouLip commented 1 year ago

https://github.com/A-kirami/nonebot-plugin-chatgpt/blob/3bb4e6e98e541a9af0dc25acee83f515702a592d/nonebot_plugin_chatgpt/chatgpt.py#L80

该插件不兼容导致的问题

惊!居然真的是这样

CMHopeSunshine commented 1 year ago

我加一个try except来处理这个问题吧

YouYouLip commented 1 year ago

我加一个try except来处理这个问题吧

感谢,虽然可能没几个人往小派蒙身上套chatgpt 但是既然您主动要提出解决这个问题的话 那我肯定不能两袖旁观 能做的就是去爱发电投喂了(呆