diff options
-rw-r--r-- | ATRI/exceptions.py | 3 | ||||
-rw-r--r-- | ATRI/plugins/status.py | 3 |
2 files changed, 6 insertions, 0 deletions
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: |