diff --git a/zhenxun/builtin_plugins/shop/__init__.py b/zhenxun/builtin_plugins/shop/__init__.py index 4b9cb36a..59f494bb 100644 --- a/zhenxun/builtin_plugins/shop/__init__.py +++ b/zhenxun/builtin_plugins/shop/__init__.py @@ -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( diff --git a/zhenxun/builtin_plugins/shop/goods_register.py b/zhenxun/builtin_plugins/shop/goods_register.py index 1f1eab68..4658ddf6 100644 --- a/zhenxun/builtin_plugins/shop/goods_register.py +++ b/zhenxun/builtin_plugins/shop/goods_register.py @@ -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!" diff --git a/zhenxun/builtin_plugins/shop/html_image.py b/zhenxun/builtin_plugins/shop/html_image.py index 49f3f046..8042c6c3 100644 --- a/zhenxun/builtin_plugins/shop/html_image.py +++ b/zhenxun/builtin_plugins/shop/html_image.py @@ -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, } )