HibiKier / zhenxun_bot

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

✨ 更新插件俄罗斯轮盘 #1585

Closed xuanerwa closed 3 weeks ago

xuanerwa commented 3 weeks ago

https://github.com/HibiKier/zhenxun_bot/issues/1584

Summary by Sourcery

Reorder the command arguments in the Russian Roulette plugin to prioritize bullet count over money amount, and set a default money value if not provided.

Enhancements:

sourcery-ai[bot] commented 3 weeks ago

Reviewer's Guide by Sourcery

This pull request updates the Russian Roulette plugin for the zhenxun_bot project. The main changes involve modifying the command structure and parameter handling for the game initialization.

File-Level Changes

Change Details Files
Reordered and made optional the parameters for the Russian Roulette game initialization command
  • Changed the order of parameters from '[金额] [子弹数]' to '[子弹数] ?[金额]'
  • Made the 'money' parameter optional
  • Updated the usage instructions and example to reflect the new parameter order
  • Modified the command handler to accommodate the new parameter order and optionality
zhenxun/plugins/russian/__init__.py
zhenxun/plugins/russian/command.py
Implemented a default bet amount when not specified
  • Added logic to set a default bet of 200 when the 'money' parameter is not provided
  • Removed the check for money <= 0, as it's now handled by the optional parameter
zhenxun/plugins/russian/__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.