Merge branches 'Beta' and 'Beta' of https://github.com/Shu-Ying/zhenxun_plugin_farm into Beta
This commit is contained in:
+50
-3
@@ -93,9 +93,10 @@ diuse_farm = on_alconna(
|
||||
Subcommand("change-name", Args["name?", str], help_text="更改农场名"),
|
||||
Subcommand("sign-in", help_text="农场签到"),
|
||||
Subcommand("admin-up", Args["num?", int], help_text="农场下阶段"),
|
||||
Subcommand("point-to-vipPoint", Args["num?", int], help_text="农场币换点券"),
|
||||
Subcommand("point-to-vipPoint", Args["num?", int], help_text="点券兑换"),
|
||||
Subcommand("my-vipPoint", help_text="我的点券"),
|
||||
Subcommand("farm-help", help_text="农场帮助"),
|
||||
Subcommand("vipSeed-shop", Args["res?", MultiVar(str)], help_text="种子商店"),
|
||||
),
|
||||
priority=5,
|
||||
block=True,
|
||||
@@ -209,9 +210,9 @@ async def _(session: Uninfo, res: Match[tuple[str, ...]]):
|
||||
page = int(raw[1])
|
||||
|
||||
if filterKey is None:
|
||||
image = await g_pShopManager.getSeedShopImage(page)
|
||||
image = await g_pShopManager.getSeedShopImage(page, 0, 0)
|
||||
else:
|
||||
image = await g_pShopManager.getSeedShopImage(filterKey, page)
|
||||
image = await g_pShopManager.getSeedShopImage(filterKey, page, 0)
|
||||
|
||||
await MessageUtils.build_message(image).send()
|
||||
|
||||
@@ -748,3 +749,49 @@ async def _(session: Uninfo):
|
||||
image = BuildImage(background=savePath)
|
||||
|
||||
await MessageUtils.build_message(image).send(reply_to=True)
|
||||
|
||||
|
||||
diuse_farm.shortcut(
|
||||
"点券商店(.*?)",
|
||||
command="我的农场",
|
||||
arguments=["vipSeed-shop"],
|
||||
prefix=True,
|
||||
)
|
||||
|
||||
|
||||
@diuse_farm.assign("vipSeed-shop")
|
||||
async def _(session: Uninfo, res: Match[tuple[str, ...]]):
|
||||
uid = str(session.user.id)
|
||||
|
||||
if not await g_pToolManager.isRegisteredByUid(uid):
|
||||
return
|
||||
|
||||
if res.result is inspect._empty:
|
||||
raw = []
|
||||
else:
|
||||
raw = res.result
|
||||
|
||||
filterKey: str | int | None = None
|
||||
page: int = 1
|
||||
|
||||
if len(raw) >= 1 and raw[0] is not None:
|
||||
first = raw[0]
|
||||
if isinstance(first, str) and first.isdigit():
|
||||
page = int(first)
|
||||
else:
|
||||
filterKey = first
|
||||
|
||||
if (
|
||||
len(raw) >= 2
|
||||
and raw[1] is not None
|
||||
and isinstance(raw[1], str)
|
||||
and raw[1].isdigit()
|
||||
):
|
||||
page = int(raw[1])
|
||||
|
||||
if filterKey is None:
|
||||
image = await g_pShopManager.getSeedShopImage(page, 0, 1)
|
||||
else:
|
||||
image = await g_pShopManager.getSeedShopImage(filterKey, page, 1)
|
||||
|
||||
await MessageUtils.build_message(image).send()
|
||||
|
||||
Reference in New Issue
Block a user