diff --git a/zhenxun/builtin_plugins/hooks/ban_hook.py b/zhenxun/builtin_plugins/hooks/ban_hook.py index d9030527..66dfb11c 100644 --- a/zhenxun/builtin_plugins/hooks/ban_hook.py +++ b/zhenxun/builtin_plugins/hooks/ban_hook.py @@ -29,6 +29,7 @@ _flmt = FreqLimiter(300) async def _( matcher: Matcher, bot: Bot, event: Event, state: T_State, session: EventSession ): + extra = {} if plugin := matcher.plugin: if metadata := plugin.metadata: extra = metadata.extra @@ -66,7 +67,12 @@ async def _( time_str = f"{hours} 小时 {minute}分钟" else: time_str = f"{minute} 分钟" - if time != -1 and ban_result and _flmt.check(user_id): + if ( + not extra.get("ignore_prompt") + and time != -1 + and ban_result + and _flmt.check(user_id) + ): _flmt.start_cd(user_id) await MessageUtils.build_message( [ diff --git a/zhenxun/utils/decorator/retry.py b/zhenxun/utils/decorator/retry.py index 2a6cc757..657cfa7b 100644 --- a/zhenxun/utils/decorator/retry.py +++ b/zhenxun/utils/decorator/retry.py @@ -1,3 +1,4 @@ +from anyio import EndOfStream from httpx import ConnectError, HTTPStatusError, TimeoutException from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_fixed @@ -11,6 +12,6 @@ class Retry: stop=stop_after_attempt(3), wait=wait_fixed(1), retry=retry_if_exception_type( - (TimeoutException, ConnectError, HTTPStatusError) + (TimeoutException, ConnectError, HTTPStatusError, EndOfStream) ), )