NumberSir / nonebot_plugin_arktools

基于 OneBot 适配器的 NoneBot2 明日方舟小工具箱插件
MIT License
69 stars 15 forks source link

猜干员与查询干员信息存在问题 #48

Closed Longxuanyue closed 1 year ago

Longxuanyue commented 1 year ago

查询干员信息:总是提示keyerror,猜干员:发送猜干员时会发送两遍消息,部分干员也是提示为干员不存在(该模块中已查验的bug干员有:温蒂、凯尔希、银灰)

贴图: ![Uploading {}MB%~T9~FN}O1@40}LS1]9.png…]()

干员查询报错: `08-24 11:57:17 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_arktools.src.tool_operator_info) failed. Traceback (most recent call last): File "", line 17, in File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot__init__.py", line 333, in run get_driver().run(*args, *kwargs) File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 199, in run uvicorn.run( File "D:\QQrobot\StarWolf.venv\Lib\site-packages\uvicorn\main.py", line 587, in run server.run() File "D:\QQrobot\StarWolf.venv\Lib\site-packages\uvicorn\server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) File "D:\Python\Lib\asyncio\runners.py", line 190, in run return runner.run(main) File "D:\Python\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) File "D:\Python\Lib\asyncio\base_events.py", line 637, in run_until_complete self.run_forever() File "D:\Python\Lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "D:\Python\Lib\asyncio\base_events.py", line 604, in run_forever self._run_once() File "D:\Python\Lib\asyncio\base_events.py", line 1909, 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:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\message.py", line 467, in check_and_run_matcher await _run_matcher(

File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\message.py", line 419, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 759, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 734, in simple_run await handler( File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\dependencies__init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot_plugin_arktools\src\tool_operator_info\init_.py", line 36, in img_bytes = await BuildOperatorInfo(cht=cht).build_whole_image() File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot_plugin_arktools\src\tool_operator_info\data_source.py", line 49, in build_whole_image skills_img: Image = await self._build_skills() File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot_plugin_arktools\src\tool_operator_info\data_source.py", line 289, in _build_skills for idx, cond in enumerate(skill.level_up_cost_condition): File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot_plugin_arktools\src\core\models_v3.py", line 1234, in level_up_cost_condition for d in self._extra_data["specializeLevelUpData"] KeyError: 'specializeLevelUpData'`

猜干员报错: `08-24 11:58:41 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_arktools.src.game_guess_operator) failed. Traceback (most recent call last): File "", line 17, in File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot__init__.py", line 333, in run get_driver().run(*args, *kwargs) File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 199, in run uvicorn.run( File "D:\QQrobot\StarWolf.venv\Lib\site-packages\uvicorn\main.py", line 587, in run server.run() File "D:\QQrobot\StarWolf.venv\Lib\site-packages\uvicorn\server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) File "D:\Python\Lib\asyncio\runners.py", line 190, in run return runner.run(main) File "D:\Python\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) File "D:\Python\Lib\asyncio\base_events.py", line 637, in run_until_complete self.run_forever() File "D:\Python\Lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "D:\Python\Lib\asyncio\base_events.py", line 604, in run_forever self._run_once() File "D:\Python\Lib\asyncio\base_events.py", line 1909, 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:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\message.py", line 467, in check_and_run_matcher await _run_matcher(

File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\message.py", line 419, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 759, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 734, in simple_run await handler( File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot\dependencies__init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot_plugin_arktools\src\game_guessoperator__init__.py", line 175, in await handle_arkguess(matcher, event, [cht_name]) File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot_plugin_arktools\src\game_guess_operator\init__.py", line 95, in handle_arkguess cht = await Character.parse_name(options.cht_name) File "D:\QQrobot\StarWolf.venv\Lib\site-packages\nonebot_plugin_arktools\src\core\models_v3.py", line 55, in parse_name raise NamedCharacterNotExistException(details=name) nonebot_plugin_arktools.src.exceptions.NamedCharacterNotExistException: 干员不存在! - 温蒂`

Longxuanyue commented 1 year ago

猜干员如果报错利用命令更新一下素材就可以了

Longxuanyue commented 1 year ago

如果干员信息报错为KeyError: 'specializeLevelUpData',可以查询已关闭的#43号讨论(没记错的话,标题就是KeyError: 'specializeLevelUpData') 解决方法: 定位到 models_v3.py 里1234行,把 specializeLevelUpData 替换成 levelUpCostCond就行了