mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-22 14:27:38 +08:00
✨ 词库性格区分
This commit is contained in:
parent
b5bd7acb7f
commit
ae0025a203
@ -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"
|
||||
}
|
||||
]
|
@ -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) # 获取插件是否可以被启用/停用
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user