From 1ccf94883a7860a0838887daaca6195745794329 Mon Sep 17 00:00:00 2001 From: snowy Date: Sat, 25 May 2024 00:13:29 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=B6=88=E6=81=AF=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=96=B0=E5=A2=9E=E6=8C=87=E5=AE=9A=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/plugins/liteyuki_pacman/npm.py | 4 ++-- liteyuki/plugins/liteyuki_statistics/__init__.py | 14 +++++++++++--- liteyuki/utils/message/markdown.py | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/liteyuki/plugins/liteyuki_pacman/npm.py b/liteyuki/plugins/liteyuki_pacman/npm.py index 2b2a1af5..7a94c5a2 100644 --- a/liteyuki/plugins/liteyuki_pacman/npm.py +++ b/liteyuki/plugins/liteyuki_pacman/npm.py @@ -480,8 +480,8 @@ async def _(result: Arparma, matcher: Matcher, event: T_MessageEvent, bot: T_Bot (mdc.link(store_plugin.author, f"https://github.com/{store_plugin.author}") if store_plugin.author else "Unknown")), mdc.quote(mdc.bold(ulang.get("npm.description")) + " " + mdc.paragraph(max(loaded_plugin.metadata.description, store_plugin.desc))), mdc.heading(ulang.get("npm.usage"), 2), - mdc.quote(escape_md(loaded_plugin.metadata.usage)), - mdc.link(ulang.get("npm.homepage"), link) if link else mdc.paragraph(ulang.get("npm.no_homepage")) + mdc.paragraph(loaded_plugin.metadata.usage.replace("\n", "\n\n")), + mdc.link(ulang.get("npm.homepage"), link) if link else mdc.paragraph(ulang.get("npm.homepage")) ] await md.send_md(compile_md(reply), bot, event=event) else: diff --git a/liteyuki/plugins/liteyuki_statistics/__init__.py b/liteyuki/plugins/liteyuki_statistics/__init__.py index 87d22c54..13330941 100644 --- a/liteyuki/plugins/liteyuki_statistics/__init__.py +++ b/liteyuki/plugins/liteyuki_statistics/__init__.py @@ -6,10 +6,18 @@ from .stat_restful_api import * __author__ = "snowykami" __plugin_meta__ = PluginMetadata( name="统计信息", - description="统计机器人的信息", + description="统计机器人的信息,包括消息、群聊等,支持排名、图表等功能", usage=( - "stat msg [limit] 查看统计次数内的消息\n" - "stat msg -g|--group [group_id] 查看群的统计信息,不带参数为全群\n" + "```\nstatistic message 查看统计消息\n" + "可选参数:\n" + " -g|--group [group_id] 指定群聊\n" + " -u|--user [user_id] 指定用户\n" + " -d|--duration [duration] 指定时长\n" + " -p|--period [period] 指定次数统计周期\n" + " -b|--bot [bot_id] 指定机器人\n" + "命令别名:\n" + " statistic|stat message|msg|m\n" + "```" ), type="application", homepage="https://github.com/snowykami/LiteyukiBot", diff --git a/liteyuki/utils/message/markdown.py b/liteyuki/utils/message/markdown.py index 919d59d5..bed2073d 100644 --- a/liteyuki/utils/message/markdown.py +++ b/liteyuki/utils/message/markdown.py @@ -34,7 +34,7 @@ def escape_decorator(func): def compile_md(comps: list[str]) -> str: """ - 编译Markdown文本 + 合成Markdown文本 Args: comps: list[str]: 组件列表