mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-14 21:52:56 +08:00
🐛 修复商品图标显示问题,移除测试道具 (#1817)
Co-authored-by: Flern <cb56ec362bbbfb5272eb941281299d8d-qq_connect@git.osc>
This commit is contained in:
parent
2a5c06702a
commit
2f939ff52b
@ -25,7 +25,6 @@ from zhenxun.utils.message import MessageUtils
|
||||
from zhenxun.utils.platform import PlatformUtils
|
||||
|
||||
from ._data_source import ShopManage, gold_rank
|
||||
from .goods_register import * # noqa: F403
|
||||
|
||||
__plugin_meta__ = PluginMetadata(
|
||||
name="商店",
|
||||
@ -57,6 +56,7 @@ __plugin_meta__ = PluginMetadata(
|
||||
).dict(),
|
||||
)
|
||||
|
||||
from .goods_register import * # noqa: F403
|
||||
|
||||
_matcher = on_alconna(
|
||||
Alconna(
|
||||
|
||||
@ -19,143 +19,15 @@ async def _(user_id: str):
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A1",
|
||||
name="神秘药水2",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
partition="小秘密",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A2",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A3",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A4",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A5",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A6",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A7",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A8",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A9",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A10",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A11",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A12",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
|
||||
|
||||
@shop_register(
|
||||
name="测试道具A13",
|
||||
price=999999,
|
||||
des="鬼知道会有什么效果,要不试试?",
|
||||
partition="TEST",
|
||||
icon="mysterious_potion.png",
|
||||
)
|
||||
async def _(user_id: str):
|
||||
pass
|
||||
await UserConsole.add_gold(
|
||||
user_id,
|
||||
1000000,
|
||||
"shop",
|
||||
)
|
||||
return "使用道具神秘药水成功!你滴金币+1000000!"
|
||||
|
||||
@ -31,14 +31,19 @@ async def html_image() -> bytes:
|
||||
goods[1].partition = "默认分区"
|
||||
if goods[1].partition not in partition_dict:
|
||||
partition_dict[goods[1].partition] = []
|
||||
icon = None
|
||||
if goods[1].icon:
|
||||
icon = (
|
||||
"data:image/png;base64,"
|
||||
+ BuildImage.open(ICON_PATH / goods[1].icon).pic2bs4()[9:]
|
||||
)
|
||||
partition_dict[goods[1].partition].append(
|
||||
{
|
||||
"id": goods[0],
|
||||
"price": goods[1].goods_price,
|
||||
"daily_limit": goods[1].daily_limit or "∞",
|
||||
"name": goods[1].goods_name,
|
||||
"icon": "data:image/png;base64,"
|
||||
+ BuildImage.open(ICON_PATH / goods[1].icon).pic2bs4()[9:],
|
||||
"icon": icon,
|
||||
"description": goods[1].goods_description,
|
||||
}
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user