diff --git a/README.md b/README.md index b34f6dd..107c6c8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -
a
-

轻雪6.2

-

轻量,高效,易于扩展

+
+a +

轻雪 6.2

+

轻量,高效,易于扩展

+
- 基于[Nonebot2](https://github.com/nonebot/nonebot2),有良好的生态支持 - 开箱即用,无需复杂配置 @@ -10,8 +12,8 @@ ## 1.安装和部署 -1. 安装`Git`和`Python3.10+` -2. 克隆项目`git clone https://github.com/snowykami/LiteyukiBot` +1. 安装 `Git` 和 `Python3.10+` 环境 +2. 克隆项目 `git clone https://github.com/snowykami/LiteyukiBot` (无法连接可以用`https://gitee.com/snowykami/LiteyukiBot`) 3. 切换目录`cd LiteyukiBot` 4. 安装依赖`pip install -r requirements.txt`(如果多个Python环境请指定后安装`pythonx -m pip install -r requirements.txt`) 5. 启动`python main.py` @@ -47,7 +49,7 @@ custom_config_1: "custom_value1" | 字段 | 参考值 | 说明 | |-------------|--------------------------|----------------------------------| -| 协议 | 反向WebSocket | 推荐使用反向ws协议进行通信,即轻雪作为服务端 | +| 协议 | 反向WebSocket | 推荐使用反向ws协议进行通信,即轻雪作为服务端 | | 地址 | ws://`addrss`/onebot/v11 | 地址取决于配置文件,本机默认为`127.0.0.1:20216` | | AccessToken | `""` | 如果你给轻雪配置了`AccessToken`,请在此填写相同的值 | @@ -83,7 +85,8 @@ custom_config_1: "custom_value1" ## 4.用户协议 1. 本项目遵循`MIT`协议,你可以自由使用,修改,分发,但是请保留原作者信息 -2. 你可以选择开启`auto_report`(默认开启),轻雪会收集运行环境的设备信息,通过安全的方式传输到轻雪服务器,用于统计运行时的设备信息,帮助我们改进轻雪,收集的数据包括但不限于:CPU,内存,插件信息,异常信息,会话负载(不含隐私部分) +2. 你可以选择开启`auto_report`(默认开启) + ,轻雪会收集运行环境的设备信息,通过安全的方式传输到轻雪服务器,用于统计运行时的设备信息,帮助我们改进轻雪,收集的数据包括但不限于:CPU,内存,插件信息,异常信息,会话负载(不含隐私部分) 3. 本项目不会收集用户的任何隐私信息,但请注意甄别第三方插件的安全性 ## 5.鸣谢 diff --git a/liteyuki/plugins/liteyuki_npm/manager.py b/liteyuki/plugins/liteyuki_npm/manager.py index 4e84a85..f286ba7 100644 --- a/liteyuki/plugins/liteyuki_npm/manager.py +++ b/liteyuki/plugins/liteyuki_npm/manager.py @@ -4,7 +4,7 @@ import nonebot.plugin from nonebot import require from nonebot.exception import FinishedException, IgnoredException from nonebot.internal.adapter import Event -from nonebot.internal.matcher import Matcher +from nonebot.internal.matcher import Matcher, current_matcher from nonebot.adapters import Bot from nonebot.message import run_preprocessor from nonebot.permission import SUPERUSER @@ -236,7 +236,8 @@ async def pre_handle(event: Event, matcher: Matcher): raise IgnoredException("Plugin disabled in session") -# @Bot.on_calling_api -# async def _(bot: Bot, api: str, data: dict[str, any]): -# # TODO 插件启用/停用检查hook -# nonebot.logger.info(f"Plugin Callapi: {api}: {data}") +@Bot.on_calling_api +async def _(bot: Bot, api: str, data: dict[str, any]): + # TODO 插件启用/停用检查hook + plugin = current_plugin + nonebot.logger.info(f"Plugin Callapi: {api}: {data}") diff --git a/liteyuki/resources/lang/zh-Kawaii.lang b/liteyuki/resources/lang/zh-Kawaii.lang index 638b6bf..15d8a96 100644 --- a/liteyuki/resources/lang/zh-Kawaii.lang +++ b/liteyuki/resources/lang/zh-Kawaii.lang @@ -1,7 +1,7 @@ language.name=简体中文(轻雪版) log.debug=调试中 -log.info=是信息 +log.info=信息 log.warning=有问题 log.error=出错辣 log.success=成功啦