NumberSir/nonebot_plugin_arktools

公招运行失败

Closed this issue · 5 comments

sacyna commented

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

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_target_characters
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\data_source.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

20230808190330

我找了半天原因发现是因为公招增加了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

我找了半天原因发现是因为公招增加了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是在哪个位置

我找了半天原因发现是因为公招增加了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

我找了半天原因发现是因为公招增加了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

感谢大佬,脚本已经活了