From 2c829e5d430bccf0153cd2f1758b69634499b297 Mon Sep 17 00:00:00 2001 From: SAGIRI-kawaii Date: Fri, 19 Aug 2022 01:19:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=BA=9B=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E7=9A=84metadata.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sagiri_bot/control.py | 1 - .../required_module/bot_management/metadata.json | 13 +++++++++++++ .../chat_recorder_handler/metadata.json | 13 +++++++++++++ .../required_module/exception_catcher/metadata.json | 13 +++++++++++++ .../handler/required_module/helper/metadata.json | 2 +- .../required_module/message_statistics/__init__.py | 6 +++--- .../message_statistics/metadata.json | 13 +++++++++++++ .../required_module/mirai_event/metadata.json | 13 +++++++++++++ .../required_module/saya_manager/metadata.json | 13 +++++++++++++ .../required_module/system_status/metadata.json | 13 +++++++++++++ 10 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 sagiri_bot/handler/required_module/bot_management/metadata.json create mode 100644 sagiri_bot/handler/required_module/chat_recorder_handler/metadata.json create mode 100644 sagiri_bot/handler/required_module/exception_catcher/metadata.json create mode 100644 sagiri_bot/handler/required_module/message_statistics/metadata.json create mode 100644 sagiri_bot/handler/required_module/mirai_event/metadata.json create mode 100644 sagiri_bot/handler/required_module/saya_manager/metadata.json create mode 100644 sagiri_bot/handler/required_module/system_status/metadata.json diff --git a/sagiri_bot/control.py b/sagiri_bot/control.py index 75c28882..a9b5b9b6 100644 --- a/sagiri_bot/control.py +++ b/sagiri_bot/control.py @@ -114,7 +114,6 @@ async def limit(event: GroupMessage) -> NoReturn: return frequency_limit_instance = create(GlobalFrequencyLimitDict) frequency_limit_instance.add_record(group, member, weight) - print(frequency_limit_instance.frequency_limit_dict) if frequency_limit_instance.blacklist_judge(group, member): if not frequency_limit_instance.announce_judge(group, member): frequency_limit_instance.blacklist_announced(group, member) diff --git a/sagiri_bot/handler/required_module/bot_management/metadata.json b/sagiri_bot/handler/required_module/bot_management/metadata.json new file mode 100644 index 00000000..99f1f397 --- /dev/null +++ b/sagiri_bot/handler/required_module/bot_management/metadata.json @@ -0,0 +1,13 @@ +{ + "name": "BotManagement", + "version": "0.1", + "display_name": "BOT管理模块", + "authors": [ + "SAGIRI-kawaii" + ], + "description": "一个可以管理BOT的插件", + "usage": "发送 setting -set key1=value1 key2=value2 ... 改变群内设置\n发送 user -grant @target [1-3] 改变成员权限等级\n发送 blacklist -add @target 添加群内黑名单\n发送 blacklist -remove @target 移除群内黑名单", + "icon": "", + "prefix": [], + "triggers": [] +} \ No newline at end of file diff --git a/sagiri_bot/handler/required_module/chat_recorder_handler/metadata.json b/sagiri_bot/handler/required_module/chat_recorder_handler/metadata.json new file mode 100644 index 00000000..67eedb9f --- /dev/null +++ b/sagiri_bot/handler/required_module/chat_recorder_handler/metadata.json @@ -0,0 +1,13 @@ +{ + "name": "ChatRecorder", + "version": "0.1", + "display_name": "群聊记录存储", + "authors": [ + "SAGIRI-kawaii" + ], + "description": "一个对聊天记录进行存储的插件,可配合词云等插件使用", + "usage": "自动触发", + "icon": "", + "prefix": [], + "triggers": [] +} \ No newline at end of file diff --git a/sagiri_bot/handler/required_module/exception_catcher/metadata.json b/sagiri_bot/handler/required_module/exception_catcher/metadata.json new file mode 100644 index 00000000..7a26aee9 --- /dev/null +++ b/sagiri_bot/handler/required_module/exception_catcher/metadata.json @@ -0,0 +1,13 @@ +{ + "name": "ExceptionCatcher", + "version": "0.1", + "display_name": "错误报告", + "authors": [ + "SAGIRI-kawaii" + ], + "description": "一个向主人报告错误的插件", + "usage": "后台发生错误时自动触发", + "icon": "", + "prefix": [], + "triggers": [] +} \ No newline at end of file diff --git a/sagiri_bot/handler/required_module/helper/metadata.json b/sagiri_bot/handler/required_module/helper/metadata.json index bd65e819..1b6b0e30 100644 --- a/sagiri_bot/handler/required_module/helper/metadata.json +++ b/sagiri_bot/handler/required_module/helper/metadata.json @@ -9,5 +9,5 @@ "usage": "发送 `/help` 即可查看所有插件", "icon": "", "prefix": ["/", ".", "#", ""], - "triggers": ["help", "帮助", "菜单", "功能"] + "triggers": ["help", "帮助", "菜单", "功能", "纱雾帮助"] } \ No newline at end of file diff --git a/sagiri_bot/handler/required_module/message_statistics/__init__.py b/sagiri_bot/handler/required_module/message_statistics/__init__.py index 3ca36ffd..4c7403c8 100644 --- a/sagiri_bot/handler/required_module/message_statistics/__init__.py +++ b/sagiri_bot/handler/required_module/message_statistics/__init__.py @@ -21,6 +21,7 @@ from sagiri_bot.orm.async_orm import orm from sagiri_bot.orm.async_orm import ChatRecord +from sagiri_bot.internal_utils import get_command from sagiri_bot.control import ( FrequencyLimit, Function, @@ -46,9 +47,8 @@ inline_dispatchers=[ Twilight( [ - FullMatch("消息量统计"), - ArgumentMatch("-group", action="store_true", optional=True) - @ "group_only", + get_command(__file__, channel.module), + ArgumentMatch("-group", action="store_true", optional=True) @ "group_only", ] ) ], diff --git a/sagiri_bot/handler/required_module/message_statistics/metadata.json b/sagiri_bot/handler/required_module/message_statistics/metadata.json new file mode 100644 index 00000000..8e466104 --- /dev/null +++ b/sagiri_bot/handler/required_module/message_statistics/metadata.json @@ -0,0 +1,13 @@ +{ + "name": "MessageStatics", + "version": "0.1", + "display_name": "消息量统计", + "authors": [ + "SAGIRI-kawaii" + ], + "description": "一个对不同事件进行处理的插件", + "usage": "在群中发送 `消息量统计` 即可\n发送 `消息量统计 -group` 可查看本群统计", + "icon": "", + "prefix": ["", "/"], + "triggers": ["消息量统计"] +} \ No newline at end of file diff --git a/sagiri_bot/handler/required_module/mirai_event/metadata.json b/sagiri_bot/handler/required_module/mirai_event/metadata.json new file mode 100644 index 00000000..3dc7edb6 --- /dev/null +++ b/sagiri_bot/handler/required_module/mirai_event/metadata.json @@ -0,0 +1,13 @@ +{ + "name": "MiraiEvent", + "version": "0.1", + "display_name": "事件处理", + "authors": [ + "SAGIRI-kawaii" + ], + "description": "一个对不同事件进行处理的插件", + "usage": "自动触发", + "icon": "", + "prefix": [], + "triggers": [] +} \ No newline at end of file diff --git a/sagiri_bot/handler/required_module/saya_manager/metadata.json b/sagiri_bot/handler/required_module/saya_manager/metadata.json new file mode 100644 index 00000000..270522b2 --- /dev/null +++ b/sagiri_bot/handler/required_module/saya_manager/metadata.json @@ -0,0 +1,13 @@ +{ + "name": "SayaManager", + "version": "0.1", + "display_name": "插件管理", + "authors": [ + "SAGIRI-kawaii" + ], + "description": "一个可以管理saya模块的插件", + "usage": "发送 `已加载插件` 查看已加载插件\n发送 `插件详情 [编号|名称]` 可查看插件详情\n发送 `[加载|重载|卸载|打开|关闭]插件 [编号|名称]` 可加载/重载/卸载/打开/关闭插件", + "icon": "", + "prefix": [], + "triggers": [] +} \ No newline at end of file diff --git a/sagiri_bot/handler/required_module/system_status/metadata.json b/sagiri_bot/handler/required_module/system_status/metadata.json new file mode 100644 index 00000000..9cdf9d8b --- /dev/null +++ b/sagiri_bot/handler/required_module/system_status/metadata.json @@ -0,0 +1,13 @@ +{ + "name": "SystemStatus", + "version": "0.1", + "display_name": "系统状态", + "authors": [ + "SAGIRI-kawaii" + ], + "description": "一个可以查看系统状态的插件", + "usage": "发送 /sys 或 '/sys -a' 或 '/sys -all' 查看CPU、内存以及图库占用信息\n发送 /sys -i 或 '/sys -info' 查看CPU、内存信息\n发送 /sys -s 或 '/sys -storage' 查看图库占用信息", + "icon": "", + "prefix": ["/"], + "triggers": ["sys", "system"] +} \ No newline at end of file