From 7140f2eced8ab17b702c1d0d9c69de97382f09f8 Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Sat, 27 Aug 2022 10:39:37 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20`ysb`=E7=BB=91=E5=AE=9A=E6=97=A0?= =?UTF-8?q?=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/manager/plugin_manager/model.py | 1 + LittlePaimon/plugins/Paimon_Bind/__init__.py | 2 +- LittlePaimon/plugins/Paimon_Gacha/__init__.py | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/LittlePaimon/manager/plugin_manager/model.py b/LittlePaimon/manager/plugin_manager/model.py index fbcadb2..2fabb93 100644 --- a/LittlePaimon/manager/plugin_manager/model.py +++ b/LittlePaimon/manager/plugin_manager/model.py @@ -43,6 +43,7 @@ class Config(BaseModel): sim_gacha_cd_group: int = Field(30, alias='模拟抽卡群冷却') sim_gacha_cd_member: int = Field(60, alias='模拟抽卡群冷却') + sim_gacha_max: int = Field(5, alias='模拟抽卡单次最多十连数') auto_myb_enable: bool = Field(True, alias='米游币自动获取开关') auto_myb_hour: int = Field(8, alias='米游币开始执行时间(小时)') diff --git a/LittlePaimon/plugins/Paimon_Bind/__init__.py b/LittlePaimon/plugins/Paimon_Bind/__init__.py index da547bf..b5725ab 100644 --- a/LittlePaimon/plugins/Paimon_Bind/__init__.py +++ b/LittlePaimon/plugins/Paimon_Bind/__init__.py @@ -76,7 +76,7 @@ async def _(event: MessageEvent, msg: Message = CommandArg()): if not msg: await ysb.finish(f'成功绑定uid为{uid.group()},如果还需绑定cookie可看教程:\ndocs.qq.com/doc/DQ3JLWk1vQVllZ2Z1', at_sender=True) - elif msg: + if msg: if data := await get_bind_game_info(msg): game_name = data['nickname'] game_uid = data['game_role_id'] diff --git a/LittlePaimon/plugins/Paimon_Gacha/__init__.py b/LittlePaimon/plugins/Paimon_Gacha/__init__.py index 018f7b2..cd049fc 100644 --- a/LittlePaimon/plugins/Paimon_Gacha/__init__.py +++ b/LittlePaimon/plugins/Paimon_Gacha/__init__.py @@ -74,6 +74,8 @@ async def _(event: MessageEvent, reGroup: Dict = RegexDict()): num = reGroup['num'] pool = reGroup['pool'] num = int(num) if num and num.isdigit() else 1 + if num > pm.config.sim_gacha_max: + await sim_gacha.finish(f'单次最多只能{pm.config.sim_gacha_max}十连哦!') pool = pool or '角色1' result = await draw_gacha_img(event.user_id, pool, num, nickname) if isinstance(event, GroupMessageEvent):