From ae0025a203661728e8c2435484b9bc8f1e1edf16 Mon Sep 17 00:00:00 2001 From: snowy Date: Sun, 2 Jun 2024 23:09:59 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E8=AF=8D=E5=BA=93=E6=80=A7?= =?UTF-8?q?=E6=A0=BC=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/public/assets/resources.json | 12 +++++++++--- liteyuki/plugins/liteyuki_pacman/npm.py | 1 - liteyuki/plugins/liteyuki_pacman/rpm.py | 20 +++++++++----------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/.vuepress/public/assets/resources.json b/docs/.vuepress/public/assets/resources.json index 1b0a6a1e..04dfeabb 100644 --- a/docs/.vuepress/public/assets/resources.json +++ b/docs/.vuepress/public/assets/resources.json @@ -31,9 +31,15 @@ "link": "https://cdn.liteyuki.icu/static/lrp/custom-device.zip" }, { - "name": "示例包3", + "name": "轻雪傲娇系词库", "author": "SnowyKami", - "description": "A simple bot that shows the status of the bot and the server.", - "link": "" + "description": "使用https://github.com/Kyomotoi/AnimeThesaurus的词库", + "link": "https://cdn.liteyuki.icu/static/lrp/liteyuki_words_aojiao.zip" + }, + { + "name": "轻雪可爱系词库", + "author": "SnowyKami", + "description": "使用https://github.com/Kyomotoi/AnimeThesaurus的词库", + "link": "https://cdn.liteyuki.icu/static/lrp/liteyuki_words_kawaii.zip" } ] \ No newline at end of file diff --git a/liteyuki/plugins/liteyuki_pacman/npm.py b/liteyuki/plugins/liteyuki_pacman/npm.py index c611496c..26bd8a29 100644 --- a/liteyuki/plugins/liteyuki_pacman/npm.py +++ b/liteyuki/plugins/liteyuki_pacman/npm.py @@ -128,7 +128,6 @@ async def _(result: Arparma, event: T_MessageEvent, bot: T_Bot, npm: Matcher): else: raise FinishedException(ulang.get("Permission Denied")) - session_enable = get_plugin_session_enable(new_event, plugin_name) # 获取插件当前状态 can_be_toggled = get_plugin_can_be_toggle(plugin_name) # 获取插件是否可以被启用/停用 diff --git a/liteyuki/plugins/liteyuki_pacman/rpm.py b/liteyuki/plugins/liteyuki_pacman/rpm.py index 7a2154c6..456c3006 100644 --- a/liteyuki/plugins/liteyuki_pacman/rpm.py +++ b/liteyuki/plugins/liteyuki_pacman/rpm.py @@ -3,6 +3,7 @@ import os import zipfile import yaml from nonebot import require +from nonebot.internal.matcher import Matcher from nonebot.permission import SUPERUSER from liteyuki.utils.base.language import get_user_lang @@ -55,10 +56,12 @@ from nonebot_plugin_alconna import Alconna, Args, on_alconna, Arparma, Subcomman ), permission=SUPERUSER ).handle() -async def _(bot: T_Bot, event: T_MessageEvent, result: Arparma): +async def _(bot: T_Bot, event: T_MessageEvent, result: Arparma, matcher: Matcher): ulang = get_user_lang(str(event.user_id)) reply = "" + send_as_md = False if result.subcommands.get("list"): + send_as_md = True loaded_rps = get_loaded_resource_packs() reply += f"{ulang.get('liteyuki.loaded_resources', NUM=len(loaded_rps))}\n" for rp in loaded_rps: @@ -176,13 +179,8 @@ async def _(bot: T_Bot, event: T_MessageEvent, result: Arparma): NUM=len(get_loaded_resource_packs()) ) else: - btn_reload = md.btn_cmd( - ulang.get("liteyuki.reload_resources"), - f"rpm reload" - ) - btn_list = md.btn_cmd( - ulang.get("liteyuki.list_resources"), - f"rpm list" - ) - reply += f"{btn_list} \n {btn_reload}" - await md.send_md(reply, bot, event=event) + pass + if send_as_md: + await md.send_md(reply, bot, event=event) + else: + await matcher.finish(reply)