Commit Graph

6 Commits

Author SHA1 Message Date
明天好像没什么
5638076328 refactor: 统一类型注解风格并优化代码结构
- 将裸 except 改为显式 Exception 捕获
- 用列表推导式替换冗余 for 循环
- 为类属性添加 ClassVar 注解
- 统一 Union/Optional 写法为 |
- 移除未使用的导入
- 修复 SQLAlchemy 空值比较语法
- 优化字符串拼接与字典更新逻辑
- 补充缺失的 noqa 注释与异常链

BREAKING CHANGE: 所有插件基类的类级字段现要求显式 ClassVar 注解,自定义插件需同步更新
2025-11-19 23:30:26 +08:00
John Richard
a79253c714 re-style: 格式化代码 2025-11-19 23:13:20 +08:00
雅诺狐
93542cadef perf(methods): 通过移除不必要的 self 参数优化方法签名
在包括 chat、plugin_system、schedule 和 mais4u 在内的多个模块中,消除冗余的实例引用。此次改动将无需访问实例状态的实用函数转换为静态方法,从而提升了内存效率,并使方法依赖关系更加清晰。
2025-11-19 23:05:00 +08:00
Windpicker-owo
fe472dff60 修复代码格式和文件名大小写问题 2025-11-19 22:55:55 +08:00
雅诺狐
31e028ab25 Refactor anti-injection system into modular subpackages
Split the anti-prompt-injector module into core, processors, management, and decision submodules for better maintainability and separation of concerns. Moved and refactored detection, shielding, statistics, user ban, message processing, and counter-attack logic into dedicated files. Updated imports and initialization in __init__.py and anti_injector.py to use the new structure. No functional changes to detection logic, but code organization is significantly improved.
2025-11-19 22:45:01 +08:00
墨梓柒
0038d9ff60 feat: 知识库小重构 2025-06-07 13:46:04 +08:00