Closed McElaga closed 2 months ago
此拉取请求重构了登录逻辑,以修复错误并使代码更灵活,以适应登录印象级别配置。主要更改包括重写 get_level_and_next_impression
函数,修复变量名和错误,并实施更改以确保当在 config.py
文件中修改印象级别配置时,登录功能仍然有效。
更改 | 详情 | 文件 |
---|---|---|
重构了 get_level_and_next_impression 函数以更好地处理印象级别 |
|
zhenxun/builtin_plugins/sign_in/utils.py |
修复错误并提高代码可读性 |
|
zhenxun/builtin_plugins/sign_in/utils.py |
提高了印象级别配置的灵活性 |
|
zhenxun/builtin_plugins/sign_in/utils.py |
请使用dev分支修改,并且保证bot运行检查通过
get_level_and_next_impression
函数,更好地整合了好感度等级最低和最高时的逻辑,并且在好感度等级最高时返回的next_impression
和impression
相等,与后续判断升级进度相契合(好感度等级最高时进度始终为100%);config.py
文件更改好感度等级相关配置时,签到功能仍然可用。Summary by Sourcery
重构印象级别逻辑以更有效地处理边缘情况,并确保与配置更改的兼容性。提高代码可读性并修复与印象级别计算相关的错误。
错误修复:
get_level_and_next_impression
函数中的逻辑,以正确处理最高印象级别,确保在达到最大级别时进度始终为100%。增强功能:
config.py
文件中印象级别配置的变化。Original summary in English
## Summary by Sourcery Refactor the impression level logic to handle edge cases more effectively and ensure compatibility with configuration changes. Improve code readability and fix bugs related to impression level calculations. Bug Fixes: - Fix the logic in the `get_level_and_next_impression` function to correctly handle the highest impression level, ensuring the progress is always 100% when the maximum level is reached. Enhancements: - Improve the flexibility of the sign-in feature to adapt to changes in impression level configurations in the `config.py` file. - Enhance code readability by renaming variables and refining function logic.