HibiKier/nonebot_plugin_gamedraw

方舟抽卡报错

whale-song opened this issue · 7 comments

12-15 15:56:41 [ERROR] nonebot | Running matcher <Matcher from nonebot_plugin_gamedraw, type=message, priority=5, temp=False> failed.
Traceback (most recent call last):
File "/home/ubuntu/mudbot/MudBot/bot.py", line 41, in
nonebot.run(app="mp_main:app")
File "/home/ubuntu/.local/lib/python3.9/site-packages/nonebot/init.py", line 277, in run
get_driver().run(host, port, *args, **kwargs)
File "/home/ubuntu/.local/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 215, in run
uvicorn.run(
File "/home/ubuntu/.local/lib/python3.9/site-packages/uvicorn/main.py", line 393, in run
server.run()
File "/home/ubuntu/.local/lib/python3.9/site-packages/uvicorn/server.py", line 50, in run
loop.run_until_complete(self.serve(sockets=sockets))
File "/home/ubuntu/.local/lib/python3.9/site-packages/nonebot/message.py", line 127, in _check_matcher
await _run_matcher(Matcher, bot, event, state)

File "/home/ubuntu/.local/lib/python3.9/site-packages/nonebot/message.py", line 155, in _run_matcher
await matcher.run(bot, event, state)
File "/home/ubuntu/.local/lib/python3.9/site-packages/nonebot/matcher.py", line 584, in run
await handler(self, bot, event, self.state)
File "/home/ubuntu/.local/lib/python3.9/site-packages/nonebot/handler.py", line 81, in call
await self.func(
File "/home/ubuntu/.local/lib/python3.9/site-packages/nonebot_plugin_gamedraw/init.py", line 67, in _
await prts.send(await prts_draw(int(num)), at_sender=True)
File "/home/ubuntu/.local/lib/python3.9/site-packages/nonebot_plugin_gamedraw/prts_handle.py", line 38, in prts_draw
operator_list, operator_dict, six_list, star_list, six_index_list = format_card_information(count, star_list)
File "/home/ubuntu/.local/lib/python3.9/site-packages/nonebot_plugin_gamedraw/prts_handle.py", line 124, in format_card_information
obj, code = _get_operator_card(add)
File "/home/ubuntu/.local/lib/python3.9/site-packages/nonebot_plugin_gamedraw/prts_handle.py", line 97, in _get_operator_card
acquire_operator = [x for x in ALL_OPERATOR if x.name == up_operator_name][0]
IndexError: list index out of range

你的prts.json中是否有数据?

已经测试过,和今天上线的新卡池有关;可能由于新六星的数据没有公布,导致抽到该六星的时候会报list index out of range的错误

如果bwiki更新不及时确实会有这种情况

是否有办法加一点容错的替代方案(比如用except补上该干员名字信息,头像放空之类的..?)

bwiki没更新的话也不能知道具体星级,建议是跳过该干员等待bwiki更新

噢,在up池信息可以获取到星级,我晚上改改

已更新