-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: 商店无法使用物品ID购买物品 #1833
Labels
bug
Something isn't working
Comments
无法复现,看看你goods_info里的数据 |
还是一样 |
把这表导出来发上来 |
goods_info.csv |
导出成sql文件 |
zhenxun.zip |
你导出一张表就行了啊,不要整个库 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
操作系统
Linux
Python 版本
3.10.10
zhenxun_bot 版本
v0.2.4-2c97eea
适配器
nonebot v11 2.1.3
协议端
NapCat 4.1.5
描述问题
在更新之后的商店中,shop中注册的道具无法使用 购买道具+物品ID购买, 只能购买道具+物品名称
sign_in 中注册的道具可以这样
复现步骤
购买神秘药水或重新在shop的register中重新注册个和神秘药水差不多的道具并使用
期望的结果
No response
截图或日志(请勿包含敏感信息如密码、令牌等)
01-12 22:02:07 [SUCCESS] nonebot | OneBot V11 1633813628 | [message.private.friend]: Message 1870821026 from 1126160939 '购买道具8'
01-12 22:02:07 [INFO] nonebot | Event will be handled by Matcher(type='message', module=zhenxun.plugins.mute.mute_message, lineno=32)
01-12 22:02:08 [INFO] nonebot | Event will be handled by Matcher(type='message', module=zhenxun.builtin_plugins.chat_history.chat_message, lineno=39)
01-12 22:02:08 [INFO] nonebot | Event will be handled by Matcher(type='message', module=zhenxun.plugins.parse_bilibili, lineno=53)
01-12 22:02:08 [INFO] nonebot | Matcher(type='message', module=zhenxun.plugins.mute.mute_message, lineno=32) running complete
01-12 22:02:08 [INFO] nonebot | Matcher(type='message', module=zhenxun.builtin_plugins.chat_history.chat_message, lineno=39) running complete
01-12 22:02:08 [INFO] nonebot | Matcher(type='message', module=zhenxun.plugins.parse_bilibili, lineno=53) running complete
01-12 22:02:08 [INFO] nonebot | Event will be handled by Matcher(type='message', module=zhenxun.plugins.black_word.black_watch, lineno=32)
01-12 22:02:08 [INFO] nonebot | Event will be handled by AlconnaMatcher(type='', module=zhenxun.builtin_plugins.shop, lineno=69)
01-12 22:02:08 [INFO] nonebot | Matcher(type='message', module=zhenxun.plugins.black_word.black_watch, lineno=32) running complete
01-12 22:02:08 [INFO] zhenxun | Adapter[OneBot V11] 平台[QQClient] 用户[1126160939] CMD[商店] 购买道具 Match(8, True), 数量: Query(num, 1)
01-12 22:02:08 [INFO] nonebot | AlconnaMatcher(type='', module=zhenxun.builtin_plugins.shop, lineno=69) running complete
01-12 22:02:08 [ERROR] nonebot | Running AlconnaMatcher(type='', module=zhenxun.builtin_plugins.shop, lineno=69) failed.
Traceback (most recent call last):
File "/opt/zhenxun_bot-dev/bot.py", line 32, in <module>
nonebot.run()
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-aHa4dPee-py3.10/lib/python3.10/site-packages/nonebot/__init__.py", line 337, in run
get_driver().run(*args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-aHa4dPee-py3.10/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 187, in run
uvicorn.run(
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-aHa4dPee-py3.10/lib/python3.10/site-packages/uvicorn/main.py", line 579, in run
server.run()
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-aHa4dPee-py3.10/lib/python3.10/site-packages/uvicorn/server.py", line 66, in run
return asyncio.run(self.serve(sockets=sockets))
File "/root/.pyenv/versions/3.10.10/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-aHa4dPee-py3.10/lib/python3.10/site-packages/nonebot/utils.py", line 254, in run_coro_with_shield
return await coro
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-aHa4dPee-py3.10/lib/python3.10/site-packages/nonebot/message.py", line 506, in check_and_run_matcher
await _run_matcher(
> File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-aHa4dPee-py3.10/lib/python3.10/site-packages/nonebot/message.py", line 458, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-aHa4dPee-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 926, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-aHa4dPee-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 863, in simple_run
await handler(
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-aHa4dPee-py3.10/lib/python3.10/site-packages/nonebot/dependencies/__init__.py", line 113, in __call__
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/opt/zhenxun_bot-dev/zhenxun/builtin_plugins/shop/__init__.py", line 170, in _
result = await ShopManage.buy_prop(session.user.id, name.result, num.result)
File "/opt/zhenxun_bot-dev/zhenxun/builtin_plugins/shop/_data_source.py", line 419, in buy_prop
goods = goods_list[int(name) - 1]
IndexError: list index out of range
01-12 22:03:39 [SUCCESS] nonebot | OneBot V11 1633813628 | [message.private.friend]: Message 1479797696 from 1126160939 '购买道具 神秘药水'
01-12 22:03:39 [INFO] nonebot | Event will be handled by Matcher(type='message', module=zhenxun.plugins.mute.mute_message, lineno=32)
01-12 22:03:39 [INFO] nonebot | Event will be handled by Matcher(type='message', module=zhenxun.builtin_plugins.chat_history.chat_message, lineno=39)
01-12 22:03:39 [INFO] nonebot | Event will be handled by Matcher(type='message', module=zhenxun.plugins.parse_bilibili, lineno=53)
01-12 22:03:39 [INFO] nonebot | Matcher(type='message', module=zhenxun.plugins.mute.mute_message, lineno=32) running complete
01-12 22:03:39 [INFO] nonebot | Matcher(type='message', module=zhenxun.builtin_plugins.chat_history.chat_message, lineno=39) running complete
01-12 22:03:39 [INFO] nonebot | Matcher(type='message', module=zhenxun.plugins.parse_bilibili, lineno=53) running complete
01-12 22:03:39 [INFO] nonebot | Event will be handled by Matcher(type='message', module=zhenxun.plugins.black_word.black_watch, lineno=32)
01-12 22:03:39 [INFO] nonebot | Event will be handled by AlconnaMatcher(type='', module=zhenxun.builtin_plugins.shop, lineno=69)
01-12 22:03:39 [INFO] nonebot | Matcher(type='message', module=zhenxun.plugins.black_word.black_watch, lineno=32) running complete
01-12 22:03:39 [INFO] zhenxun | Adapter[OneBot V11] 平台[QQClient] 用户[1126160939] CMD[商店] 购买道具 Match(神秘药水, True), 数量: Query(num, 1)
01-12 22:03:39 [INFO] zhenxun | 用户[1126160939] CMD[购买道具] 花费 999999.0 金币购买 神秘药水 ×1 成功!
The text was updated successfully, but these errors were encountered: