Skip to content

Commit

Permalink
✨ 更新插件俄罗斯轮盘 (#1585)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanerwa authored Aug 27, 2024
1 parent 61ab7ef commit 72641c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions zhenxun/plugins/russian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
usage="""
又到了决斗时刻
指令:
装弹 [金额] [子弹数] ?[at]: 开启游戏,装填子弹,可选自定义金额,或邀请决斗对象
装弹 [子弹数] ?[金额] ?[at]: 开启游戏,装填子弹,可选自定义金额,或邀请决斗对象
接受对决: 接受当前存在的对决
拒绝对决: 拒绝邀请的对决
开枪: 开出未知的一枪
结算: 强行结束当前比赛 (仅当一方未开枪超过30秒时可使用)
我的战绩: 对,你的战绩
轮盘胜场排行/轮盘败场排行/轮盘欧洲人排行/轮盘慈善家排行/轮盘最高连胜排行/轮盘最高连败排行: 各种排行榜
示例:装弹 100 3 @sdd
示例:装弹 3 100 @sdd
* 注:同一时间群内只能有一场对决 *
""".strip(),
extra=PluginExtraData(
Expand All @@ -56,10 +56,11 @@


@_russian_matcher.handle()
async def _(money: int, num: Match[str], at_user: Match[alcAt]):
_russian_matcher.set_path_arg("money", money)
async def _(num: Match[str], money: Match[int], at_user: Match[alcAt]):
if num.available:
_russian_matcher.set_path_arg("num", num.result)
if money.available:
_russian_matcher.set_path_arg("money", money.result)
if at_user.available:
_russian_matcher.set_path_arg("at_user", at_user.result.target)

Expand All @@ -72,8 +73,8 @@ async def _(
session: EventSession,
message: UniMsg,
arparma: Arparma,
money: int,
num: str,
money: Match[int],
at_user: Match[alcAt],
uname: str = UserName(),
):
Expand All @@ -84,8 +85,7 @@ async def _(
await MessageUtils.build_message("用户id为空...").finish()
if not gid:
await MessageUtils.build_message("群组id为空...").finish()
if money <= 0:
await MessageUtils.build_message("赌注金额必须大于0!").finish(reply_to=True)
money = money.result if money.available else 200
if num in ["取消", "算了"]:
await MessageUtils.build_message("已取消装弹...").finish()
if not num.isdigit():
Expand Down
2 changes: 1 addition & 1 deletion zhenxun/plugins/russian/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
_russian_matcher = on_alconna(
Alconna(
"俄罗斯轮盘",
Args["money", int]["num?", str]["at_user?", alcAt],
Args["num?", str]["money?", int]["at_user?", alcAt],
),
aliases={"装弹", "俄罗斯转盘"},
rule=ensure_group,
Expand Down

0 comments on commit 72641c7

Please sign in to comment.