From 9767818e5d024a1880098c7548eefede929932e4 Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Wed, 24 Aug 2022 14:39:39 +0800 Subject: [PATCH] :bug: fix gacha cooldown --- LittlePaimon/plugins/Paimon_Gacha/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LittlePaimon/plugins/Paimon_Gacha/__init__.py b/LittlePaimon/plugins/Paimon_Gacha/__init__.py index 3624e58..92bf13f 100644 --- a/LittlePaimon/plugins/Paimon_Gacha/__init__.py +++ b/LittlePaimon/plugins/Paimon_Gacha/__init__.py @@ -76,8 +76,9 @@ async def _(event: MessageEvent, reGroup: Dict = RegexDict()): num = int(num) if num and num.isdigit() else 1 pool = pool or '角色1' result = await draw_gacha_img(event.user_id, pool, num, nickname) - freq_limiter.start(f'gacha-group{event.group_id}', pm.get_plugin_config('Paimon_Gacha', '群冷却', 30)) - freq_limiter.start(f'gacha-group{event.group_id}-{event.user_id}', pm.get_plugin_config('Paimon_Gacha', '群员冷却', 60)) + if isinstance(event, GroupMessageEvent): + freq_limiter.start(f'gacha-group{event.group_id}', pm.get_plugin_config('Paimon_Gacha', '群冷却', 30)) + freq_limiter.start(f'gacha-group{event.group_id}-{event.user_id}', pm.get_plugin_config('Paimon_Gacha', '群员冷却', 60)) await sim_gacha.finish(result)