forked from bot/app
feat: 添加了网页监控面板
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import nonebot.plugin
|
||||
from nonebot import on_command
|
||||
from nonebot.permission import SUPERUSER
|
||||
|
||||
from src.utils.adapter import MessageEvent
|
||||
from src.utils.language import get_user_lang
|
||||
|
||||
@ -9,8 +11,12 @@ toggle_plugin = on_command("enable-plugin", aliases={"启用插件", "禁用插
|
||||
|
||||
@list_plugins.handle()
|
||||
async def _(event: MessageEvent):
|
||||
lang = get_user_lang(event.user_id)
|
||||
reply = lang.get("npm.current_plugins")
|
||||
lang = get_user_lang(str(event.user_id))
|
||||
reply = lang.get("npm.loaded_plugins")
|
||||
for plugin in nonebot.get_loaded_plugins():
|
||||
reply += f"\n- {plugin.name}"
|
||||
# 检查是否有 metadata 属性
|
||||
if plugin.metadata:
|
||||
reply += f"\n- {plugin.metadata.name}"
|
||||
else:
|
||||
reply += f"\n- {plugin.name}"
|
||||
await list_plugins.finish(reply)
|
||||
|
Reference in New Issue
Block a user