词库性格区分

This commit is contained in:
远野千束 2024-06-02 23:09:59 +08:00
parent b5bd7acb7f
commit ae0025a203
3 changed files with 18 additions and 15 deletions

View File

@ -31,9 +31,15 @@
"link": "https://cdn.liteyuki.icu/static/lrp/custom-device.zip" "link": "https://cdn.liteyuki.icu/static/lrp/custom-device.zip"
}, },
{ {
"name": "示例包3", "name": "轻雪傲娇系词库",
"author": "SnowyKami", "author": "SnowyKami",
"description": "A simple bot that shows the status of the bot and the server.", "description": "使用https://github.com/Kyomotoi/AnimeThesaurus的词库",
"link": "" "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"
} }
] ]

View File

@ -128,7 +128,6 @@ async def _(result: Arparma, event: T_MessageEvent, bot: T_Bot, npm: Matcher):
else: else:
raise FinishedException(ulang.get("Permission Denied")) raise FinishedException(ulang.get("Permission Denied"))
session_enable = get_plugin_session_enable(new_event, plugin_name) # 获取插件当前状态 session_enable = get_plugin_session_enable(new_event, plugin_name) # 获取插件当前状态
can_be_toggled = get_plugin_can_be_toggle(plugin_name) # 获取插件是否可以被启用/停用 can_be_toggled = get_plugin_can_be_toggle(plugin_name) # 获取插件是否可以被启用/停用

View File

@ -3,6 +3,7 @@ import os
import zipfile import zipfile
import yaml import yaml
from nonebot import require from nonebot import require
from nonebot.internal.matcher import Matcher
from nonebot.permission import SUPERUSER from nonebot.permission import SUPERUSER
from liteyuki.utils.base.language import get_user_lang 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 permission=SUPERUSER
).handle() ).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)) ulang = get_user_lang(str(event.user_id))
reply = "" reply = ""
send_as_md = False
if result.subcommands.get("list"): if result.subcommands.get("list"):
send_as_md = True
loaded_rps = get_loaded_resource_packs() loaded_rps = get_loaded_resource_packs()
reply += f"{ulang.get('liteyuki.loaded_resources', NUM=len(loaded_rps))}\n" reply += f"{ulang.get('liteyuki.loaded_resources', NUM=len(loaded_rps))}\n"
for rp in loaded_rps: 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()) NUM=len(get_loaded_resource_packs())
) )
else: else:
btn_reload = md.btn_cmd( pass
ulang.get("liteyuki.reload_resources"), if send_as_md:
f"rpm reload" await md.send_md(reply, bot, event=event)
) else:
btn_list = md.btn_cmd( await matcher.finish(reply)
ulang.get("liteyuki.list_resources"),
f"rpm list"
)
reply += f"{btn_list} \n {btn_reload}"
await md.send_md(reply, bot, event=event)