NumberSir / nonebot_plugin_arktools

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

公招运行失败 #47

Closed sacyna closed 1 year ago

sacyna commented 1 year ago

公招能识别出标签来,但是下一步失败了

08-08 18:56:34 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_arktools.src.tool_open_recruitment) failed. Traceback (most recent call last): File "", line 17, in File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\nonebot__init__.py", line 333, in run get_driver().run(*args, *kwargs) File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 199, in run uvicorn.run( File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\uvicorn\main.py", line 568, in run server.run() File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\uvicorn\server.py", line 59, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete self.run_forever() File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 603, in run_forever self._run_once() File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1906, in _run_once handle._run() File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\nonebot\message.py", line 467, in check_and_run_matcher await _run_matcher(

File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\nonebot\message.py", line 419, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Users\DELL\Desktop\test\first.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\DELL\Desktop\test\first.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 734, in simple_run await handler( File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\nonebot\dependencies__init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\nonebot_plugin_arktools\src\tool_open_recruitment\init_.py", line 63, in recruit_list = await BuildRecruitmentCard.build_target_characters(tags) File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\nonebot_plugin_arktools\src\tool_open_recruitment\data_source.py", line 236, in build_targetcharacters chts = [(await Character().init()) for _ in await get_recruitment_available()] # 所有可公招的干员 File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\nonebot_plugin_arktools\src\tool_open_recruitment\datasource.py", line 236, in chts = [(await Character().init()) for _ in await get_recruitment_available()] # 所有可公招的干员 File "C:\Users\DELL\Desktop\test\first.venv\lib\site-packages\nonebot_plugin_arktools\src\core\models_v3.py", line 40, in init raise # TODO RuntimeError: No active exception to reraise

sacyna commented 1 year ago

20230808190330

howrain commented 1 year ago

我找了半天原因发现是因为公招增加了Friston-3,但是character_swap.json表中没有对应的干员ID和name导致找不到。 data = await CharacterModel.filter(charId=self._id).first() 所以这里才查不到干员 在character_swap.json增加个"Friston-3": "char_4093_frston"就行了,另外记得更新下资源。 另外我发现因为资源文件char_patch_table.json和character_table.json新增了个displayTokenDict字段,所以在CharacterModel类中需要额外增加个字段displayTokenDict = fields.JSONField(null=True)

sacyna commented 1 year ago

我找了半天原因发现是因为公招增加了Friston-3,但是character_swap.json表中没有对应的干员ID和name导致找不到。 data = await CharacterModel.filter(charId=self._id).first() 所以这里才查不到干员 在character_swap.json增加个"Friston-3": "char_4093_frston"就行了,另外记得更新下资源。 另外我发现因为资源文件char_patch_table.json和character_table.json新增了个displayTokenDict字段,所以在CharacterModel类中需要额外增加个字段displayTokenDict = fields.JSONField(null=True)

请问CharacterModel是在哪个位置

howrain commented 1 year ago

我找了半天原因发现是因为公招增加了Friston-3,但是character_swap.json表中没有对应的干员ID和name导致找不到。 data = await CharacterModel.filter(charId=self._id).first() 所以这里才查不到干员 在character_swap.json增加个"Friston-3": "char_4093_frston"就行了,另外记得更新下资源。 另外我发现因为资源文件char_patch_table.json和character_table.json新增了个displayTokenDict字段,所以在CharacterModel类中需要额外增加个字段displayTokenDict = fields.JSONField(null=True)

请问CharacterModel是在哪个位置

nonebot_plugin_arktools/src/core/database/game_sqlite.py

sacyna commented 1 year ago

我找了半天原因发现是因为公招增加了Friston-3,但是character_swap.json表中没有对应的干员ID和name导致找不到。 data = await CharacterModel.filter(charId=self._id).first() 所以这里才查不到干员 在character_swap.json增加个"Friston-3": "char_4093_frston"就行了,另外记得更新下资源。 另外我发现因为资源文件char_patch_table.json和character_table.json新增了个displayTokenDict字段,所以在CharacterModel类中需要额外增加个字段displayTokenDict = fields.JSONField(null=True)

请问CharacterModel是在哪个位置

nonebot_plugin_arktools/src/core/database/game_sqlite.py

感谢大佬,脚本已经活了