HibiKier / zhenxun_bot

基于 Nonebot2 开发,非常可爱的绪山真寻bot
GNU Affero General Public License v3.0
3.36k stars 605 forks source link

✨ 签到/金币排行限制最大人数 #1615

Closed HibiKier closed 1 month ago

HibiKier commented 1 month ago

Summary by Sourcery

在登录和金币排行榜中实施对可显示用户最大数量的限制,将其限制为50。

增强功能:

Original summary in English ## Summary by Sourcery Implement a restriction on the maximum number of users that can be displayed in the sign-in and gold ranking lists, capping it at 50. Enhancements: - Limit the maximum number of users displayed in the ranking list to 50 for both sign-in and gold ranking features.
sourcery-ai[bot] commented 1 month ago

审核指南 by Sourcery

此拉取请求实现了对登录和金币排行榜中显示的最大用户数量的限制。它还改进了命令参数的处理,并为无效输入添加了错误消息。

文件级更改

更改 详情 文件
为排行榜实现最多50个用户的限制
  • 添加检查以限制登录排行榜中的用户数量为50
  • 添加检查以限制金币排行榜中的用户数量为50
  • 当请求的数量超过50时显示错误消息
zhenxun/builtin_plugins/sign_in/__init__.py
zhenxun/builtin_plugins/shop/__init__.py
改进命令参数处理
  • 将登录列表命令中的'num'参数更改为可选,默认值为10
  • 使用AlconnaQuery处理登录和商店插件中的'num'参数
  • 在gold-list子命令中将'num'参数设为必需
zhenxun/builtin_plugins/sign_in/__init__.py
zhenxun/builtin_plugins/shop/__init__.py
增强私聊场景的错误处理
  • 添加检查以防止在私聊中查看特定群组的金币排行榜
  • 在私聊中显示错误消息,建议使用全局排行榜命令
zhenxun/builtin_plugins/shop/__init__.py

提示 - 通过在拉取请求中评论`@sourcery-ai review`来触发新的Sourcery审核。 - 通过直接回复审核评论继续与Sourcery的讨论。 - 您可以随时通过访问您的[仪表板](https://app.sourcery.ai)更改审核设置: - 启用或禁用Sourcery生成的拉取请求摘要或审核指南; - 更改审核语言; - 如果您有任何问题或反馈,您可以随时[联系我们](mailto:support@sourcery.ai)。
Original review guide in English ## Reviewer's Guide by Sourcery This pull request implements a limit on the maximum number of users displayed in the sign-in and gold coin ranking lists. It also improves the handling of command arguments and adds error messages for invalid inputs. ### File-Level Changes | Change | Details | Files | | ------ | ------- | ----- | | Implement a maximum limit of 50 users for ranking lists |
  • Add a check to limit the number of users in the sign-in ranking to 50
  • Add a check to limit the number of users in the gold coin ranking to 50
  • Display an error message when the requested number exceeds 50
| `zhenxun/builtin_plugins/sign_in/__init__.py`
`zhenxun/builtin_plugins/shop/__init__.py` | | Improve command argument handling |
  • Change the 'num' argument in sign-in list command to be optional with a default value of 10
  • Use AlconnaQuery for handling the 'num' argument in both sign-in and shop plugins
  • Make the 'num' argument required in the gold-list subcommand
| `zhenxun/builtin_plugins/sign_in/__init__.py`
`zhenxun/builtin_plugins/shop/__init__.py` | | Enhance error handling for private chat scenarios |
  • Add a check to prevent viewing group-specific gold rankings in private chats
  • Display an error message suggesting to use the global ranking command in private chats
| `zhenxun/builtin_plugins/shop/__init__.py` | ---
Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.