From 43922296596f16a47e8c007db7f493cfaabc72d0 Mon Sep 17 00:00:00 2001 From: Kyomotoi <0w0@imki.moe> Date: Sun, 12 Feb 2023 21:11:17 +0800 Subject: =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20=E4=BF=AE=E5=A4=8D=E8=B6=85?= =?UTF-8?q?=E5=87=BA=E9=99=90=E5=88=B6=E4=BB=8D=E7=BB=A7=E7=BB=AD=E8=A7=A6?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/exceptions.py | 3 +++ ATRI/plugins/status.py | 3 +++ 2 files changed, 6 insertions(+) (limited to 'ATRI') diff --git a/ATRI/exceptions.py b/ATRI/exceptions.py index 03159b9..1f29238 100644 --- a/ATRI/exceptions.py +++ b/ATRI/exceptions.py @@ -136,6 +136,9 @@ async def _(bot: Bot, event, matcher: Matcher, exception: Optional[Exception]): msg = MessageBuilder("该群报错提示已达限制, 将冷却10min").text("如需反馈请: 来杯红茶") else: limiter.increase(group_id) + + if limiter.get_times(group_id) > 3: + return try: await bot.send(event, msg) diff --git a/ATRI/plugins/status.py b/ATRI/plugins/status.py index 70ea18d..ad86868 100644 --- a/ATRI/plugins/status.py +++ b/ATRI/plugins/status.py @@ -46,6 +46,9 @@ async def _(): if not stat: log.warning("资源消耗异常") + if limiter.get_times("114514") > 5: + return + try: bot = get_bot() except Exception: -- cgit v1.2.3