输入抽卡指令,不返回任何结果,同时报错:IndexError: Cannot choose from an empty sequence
可以正常初始化,也不影响其它插件。具体log可以见下面。
另外,卡池信息可能需要更新了,使用arkkit init的时候 阿米娅(医疗) 图片404了。
2024-11-28 05:03:31.753 | ERROR | arknights_toolkit.update.main:fetch_image:160 - failed to get image of 阿米娅(医疗): status code: 404
复现步骤
正常下载插件所需图片资源:nb arkgacha init
运行Bot并初始化正常:nb run --reload
在QQ上对机器人发出指令 方舟抽卡方舟十连,不返回结果并报错。
期望的结果
输出抽卡结果
截图或日志
11-28 04:57:37 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_arkgacha, lineno=74)
11-28 04:57:37 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_arkgacha, lineno=74) running complete
11-28 04:57:37 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_arkgacha, lineno=74) failed.
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/nonebot/__init__.py", line 335, in run
get_driver().run(*args, **kwargs)
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/nonebot/drivers/fastapi.py", line 186, in run
uvicorn.run(
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 579, in run
server.run()
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/nonebot/message.py", line 476, in check_and_run_matcher
await _run_matcher(
> File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/nonebot/message.py", line 428, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/nonebot/internal/matcher/matcher.py", line 850, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/nonebot/internal/matcher/matcher.py", line 825, in simple_run
await handler(
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/nonebot/dependencies/__init__.py", line 94, in __call__
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/nonebot_plugin_arkgacha/__init__.py", line 188, in _
res = gacha.gacha(user, 10)
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/arknights_toolkit/gacha/main.py", line 99, in gacha
cache.append(self.generate_operator(ans))
File "/home/ubuntu/nonebot/GlaceonBot/.venv/lib/python3.12/site-packages/arknights_toolkit/gacha/main.py", line 134, in generate_operator
return Operator(random.choice(card_list), 4)
File "/usr/lib/python3.12/random.py", line 347, in choice
raise IndexError('Cannot choose from an empty sequence')
IndexError: Cannot choose from an empty sequence
操作系统
Linux
Python 版本
3.12
NoneBot 版本
2.4.0
适配器
Onebot V11
描述问题
输入抽卡指令,不返回任何结果,同时报错:
IndexError: Cannot choose from an empty sequence
可以正常初始化,也不影响其它插件。具体log可以见下面。
另外,卡池信息可能需要更新了,使用
arkkit init
的时候 阿米娅(医疗) 图片404了。2024-11-28 05:03:31.753 | ERROR | arknights_toolkit.update.main:fetch_image:160 - failed to get image of 阿米娅(医疗): status code: 404
复现步骤
正常下载插件所需图片资源:
nb arkgacha init
运行Bot并初始化正常:
nb run --reload
在QQ上对机器人发出指令
方舟抽卡
方舟十连
,不返回结果并报错。期望的结果
输出抽卡结果
截图或日志