Closed HibiKier closed 1 month ago
此拉取请求重构了 Zhenxun 机器人的帮助功能,重点在于改进代码组织、降低复杂性,并添加用户权限检查。更改包括将帮助生成拆分为不同类型的帮助(HTML、Zhenxun 和普通)的独立模块,引入一个新函数来检查用户权限,并更新主帮助命令以使用这些新模块。
更改 | 详情 | 文件 |
---|---|---|
将帮助图像生成重构为独立模块 |
|
zhenxun/builtin_plugins/help/_utils.py zhenxun/builtin_plugins/help/_data_source.py zhenxun/builtin_plugins/help/html_help.py zhenxun/builtin_plugins/help/normal_help.py zhenxun/builtin_plugins/help/zhenxun_help.py |
为帮助命令实现用户权限检查 |
|
zhenxun/builtin_plugins/help/_data_source.py |
简化并重组与帮助相关的配置 |
|
zhenxun/builtin_plugins/help/_config.py zhenxun/builtin_plugins/help/__init__.py |
更新平台实用工具以包含头像 URL 检索 |
|
zhenxun/utils/platform.py |
Summary by Sourcery
重构帮助插件以限制普通用户查询管理插件,并将图像构建过程模块化。引入函数以分类插件并确定其状态,并添加方法以检索用户头像URL。
增强功能:
Original summary in English
## Summary by Sourcery Refactor the help plugin to restrict normal users from querying management plugins and modularize the image building process. Introduce functions to classify plugins and determine their status, and add a method to retrieve user avatar URLs. Enhancements: - Refactor the help plugin to modularize the image building process into separate files for HTML, normal, and Zhenxun help images. - Introduce a new function to classify plugins and determine their status based on group and user permissions. - Add a new method to retrieve user avatar URLs based on the platform.