diff --git a/docs/deployment/config.md b/docs/deployment/config.md index 9703893..8cb37e5 100644 --- a/docs/deployment/config.md +++ b/docs/deployment/config.md @@ -15,7 +15,7 @@ tag: ```yaml # 生成文件的配置项 -command_start: [ "/", " " ] # 指令前缀 +command_start: [ "/", "" ] # 指令前缀,若没有"",请开启alconna_use_command_start host: 127.0.0.1 # 监听地址,默认为本机,若要对外开放请填写0.0.0.0或者你的公网IP port: 20216 # 绑定端口 nickname: [ "liteyuki" ] # 机器人昵称 @@ -35,6 +35,8 @@ fake_device_info: # 统计卡片显示的虚假设备信息,用于保护隐私 frequency: 3600 # CPU主频:MHz mem: total: 32768000000 # 内存总数:字节 +alconna_use_command_start: false # alconna是否使用默认指令前缀,默认false +alconna_auto_completion: false # alconna是否自动补全指令,默认false,建议开启 # 其他Nonebot插件的配置项 custom_config_1: "custom_value1" diff --git a/liteyuki/bin/libhello.dll b/liteyuki/bin/libhello.dll new file mode 100644 index 0000000..5b10e00 Binary files /dev/null and b/liteyuki/bin/libhello.dll differ diff --git a/liteyuki/liteyuki_main/__init__.py b/liteyuki/liteyuki_main/__init__.py index b209916..6d147c6 100644 --- a/liteyuki/liteyuki_main/__init__.py +++ b/liteyuki/liteyuki_main/__init__.py @@ -1,6 +1,5 @@ from nonebot.plugin import PluginMetadata -from liteyuki.utils.data_manager import * from liteyuki.utils.language import get_default_lang from .core import * from .loader import * diff --git a/liteyuki/liteyuki_main/webdash.py b/liteyuki/liteyuki_main/webdash.py index 12a2984..d68ebc5 100644 --- a/liteyuki/liteyuki_main/webdash.py +++ b/liteyuki/liteyuki_main/webdash.py @@ -1,20 +1,17 @@ -import json -import random +import platform +import nonebot import psutil -import requests -from PIL import Image +from cpuinfo import get_cpu_info +from nonebot import on_command from nonebot.adapters.onebot.v11 import MessageSegment from nonebot.permission import SUPERUSER -from liteyuki.utils.htmlrender import template_to_pic, html_to_pic -from liteyuki.utils.language import get_user_lang -from liteyuki.utils.liteyuki_api import liteyuki_api -from liteyuki.utils.ly_typing import T_Bot, T_MessageEvent -from liteyuki.utils.message import Markdown as md -from liteyuki.utils.resource import get_path -from nonebot import on_command -from cpuinfo import get_cpu_info +from liteyuki.utils import __NAME__, __VERSION__ +from liteyuki.utils.htmlrender import template_to_pic +from liteyuki.utils.language import get_user_lang +from liteyuki.utils.ly_typing import T_Bot, T_MessageEvent +from liteyuki.utils.resource import get_path from liteyuki.utils.tools import convert_size stats = on_command("stats", aliases={"状态"}, priority=5, permission=SUPERUSER) @@ -100,8 +97,10 @@ async def _(bot: T_Bot, event: T_MessageEvent): protocol_names.get(version_info.get("protocol_name"), "Linux"), version_info.get("app_name"), version_info.get("app_version"), f"{ulang.get('liteyuki.stats.groups')} {groups}", f"{ulang.get('liteyuki.stats.friends')} {friends}", f"{ulang.get('liteyuki.stats.sent')} {statistics.get('message_sent', 0)}", - f"{ulang.get('liteyuki.stats.received')} {statistics.get('message_received', 0)}" \ - ], + f"{ulang.get('liteyuki.stats.received')} {statistics.get('message_received', 0)}", + f"{platform.python_implementation()} {platform.python_version()}", + f"Nonebot {nonebot.__version__}", f"{__NAME__} {__VERSION__}" + ], "CPU_TAGS" : [ f"{brand} {cpu_info.get('arch', 'Unknown')}", f"{fake_device_info.get('cpu', {}).get('cores', psutil.cpu_count(logical=False))}C " diff --git a/liteyuki/utils/message.py b/liteyuki/utils/message.py index 5578126..3985045 100644 --- a/liteyuki/utils/message.py +++ b/liteyuki/utils/message.py @@ -9,9 +9,12 @@ import nonebot from nonebot.adapters.onebot import v11, v12 from typing import Any +from . import load_from_yaml from .liteyuki_api import liteyuki_api from .ly_typing import T_Bot, T_MessageEvent +config = load_from_yaml("config.yml") + class Markdown: @staticmethod @@ -143,6 +146,8 @@ class Markdown: markdown格式的可点击回调按钮 """ + if "" not in config.get("command_start", ["/"]): + cmd = f"{config['command_start'][0]}{cmd}" return f"[{name}](mqqapi://aio/inlinecmd?command={quote(cmd)}&reply={str(reply).lower()}&enter={str(enter).lower()})" @staticmethod