diff --git a/liteyuki/liteyuki_main/core.py b/liteyuki/liteyuki_main/core.py index e6b8d8b..5116607 100644 --- a/liteyuki/liteyuki_main/core.py +++ b/liteyuki/liteyuki_main/core.py @@ -1,9 +1,12 @@ +from nonebot import require from nonebot.permission import SUPERUSER -from nonebot_plugin_alconna import Alconna, Arparma, on_alconna from liteyuki.utils.config import config from liteyuki.utils.ly_typing import T_Bot +require("nonebot_plugin_alconna") +from nonebot_plugin_alconna import on_alconna, Alconna + cmd_liteyuki = on_alconna( Alconna( "liteyuki" diff --git a/liteyuki/plugins/liteyuki_markdowntest.py b/liteyuki/plugins/liteyuki_markdowntest.py index b1a013c..3f8832b 100644 --- a/liteyuki/plugins/liteyuki_markdowntest.py +++ b/liteyuki/plugins/liteyuki_markdowntest.py @@ -1,13 +1,11 @@ import nonebot -from nonebot import on_command, on_message -from nonebot.adapters.onebot.v11 import MessageSegment -from nonebot.exception import FinishedException +from nonebot import on_command from nonebot.params import CommandArg from nonebot.permission import SUPERUSER from nonebot.plugin import PluginMetadata +from liteyuki.utils.ly_typing import T_Bot, T_MessageEvent, v11 from liteyuki.utils.message import send_markdown -from liteyuki.utils.ly_typing import T_Message, T_Bot, v11, T_MessageEvent md_test = on_command("mdts", aliases={"会话md"}, permission=SUPERUSER) md_group = on_command("mdg", aliases={"群md"}, permission=SUPERUSER) diff --git a/liteyuki/plugins/liteyuki_npm/installer.py b/liteyuki/plugins/liteyuki_npm/installer.py index 40b9f67..aa4f34f 100644 --- a/liteyuki/plugins/liteyuki_npm/installer.py +++ b/liteyuki/plugins/liteyuki_npm/installer.py @@ -6,14 +6,16 @@ import aiohttp import nonebot import pip from arclet.alconna import Arparma, MultiVar +from nonebot import require from nonebot.permission import SUPERUSER -from nonebot_plugin_alconna import Alconna, Args, Subcommand, on_alconna - from liteyuki.utils.language import get_user_lang from liteyuki.utils.ly_typing import T_Bot from liteyuki.utils.message import Markdown as md, send_markdown from .common import * +require("nonebot_plugin_alconna") +from nonebot_plugin_alconna import Alconna, Args, Subcommand, on_alconna + npm_alc = on_alconna( Alconna( ["npm", "插件"], diff --git a/liteyuki/plugins/liteyuki_npm/manager.py b/liteyuki/plugins/liteyuki_npm/manager.py index 04d2a16..ae245e1 100644 --- a/liteyuki/plugins/liteyuki_npm/manager.py +++ b/liteyuki/plugins/liteyuki_npm/manager.py @@ -1,12 +1,11 @@ import os import nonebot.plugin -from nonebot import on_command +from nonebot import on_command, require from nonebot.exception import FinishedException from nonebot.internal.matcher import Matcher from nonebot.message import run_preprocessor from nonebot.permission import SUPERUSER -from nonebot_plugin_alconna import on_alconna, Alconna, Args, Arparma from liteyuki.utils.data_manager import GroupChat, InstalledPlugin, User, group_db, plugin_db, user_db from liteyuki.utils.message import Markdown as md, send_markdown @@ -16,6 +15,9 @@ from liteyuki.utils.language import get_user_lang from .common import get_plugin_can_be_toggle, get_plugin_global_enable, get_plugin_session_enable, get_plugin_default_enable from .installer import get_store_plugin, npm_update +require("nonebot_plugin_alconna") +from nonebot_plugin_alconna import on_alconna, Alconna, Args, Arparma + list_plugins = on_alconna( Alconna( ['list-plugins', "插件列表", "列出插件"], @@ -53,7 +55,6 @@ async def _(event: T_MessageEvent, bot: T_Bot): session_enable = get_plugin_session_enable(event, plugin.module_name) default_enable = get_plugin_default_enable(plugin.module_name) - if store_plugin: btn_homepage = md.link(lang.get('npm.homepage'), store_plugin.homepage) show_name = store_plugin.name diff --git a/liteyuki/plugins/liteyuki_user/profile_manager.py b/liteyuki/plugins/liteyuki_user/profile_manager.py index a78e6e3..c7e292b 100644 --- a/liteyuki/plugins/liteyuki_user/profile_manager.py +++ b/liteyuki/plugins/liteyuki_user/profile_manager.py @@ -1,6 +1,6 @@ from typing import Optional -from nonebot_plugin_alconna import Alconna, Args, Arparma, Subcommand, on_alconna +from nonebot import require from liteyuki.utils.data import LiteModel from liteyuki.utils.data_manager import User, user_db @@ -8,6 +8,9 @@ from liteyuki.utils.language import Language, get_all_lang, get_user_lang from liteyuki.utils.ly_typing import T_Bot, T_MessageEvent from liteyuki.utils.message import Markdown as md, send_markdown +require("nonebot_plugin_alconna") +from nonebot_plugin_alconna import Alconna, Args, Arparma, Subcommand, on_alconna + profile_alc = on_alconna( Alconna( ["profile", "个人信息"],