diff options
author | Kyomotoi <[email protected]> | 2023-02-12 21:11:17 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2023-02-12 21:11:17 +0800 |
commit | 43922296596f16a47e8c007db7f493cfaabc72d0 (patch) | |
tree | 45f567c8075faeb6897a901f7a89325eea3ebe1a /ATRI | |
parent | 233d4e5c484ee9a407a09db8ed8e41ff1140456f (diff) | |
download | ATRI-43922296596f16a47e8c007db7f493cfaabc72d0.tar.gz ATRI-43922296596f16a47e8c007db7f493cfaabc72d0.tar.bz2 ATRI-43922296596f16a47e8c007db7f493cfaabc72d0.zip |
🚑️ 修复超出限制仍继续触发
Diffstat (limited to 'ATRI')
-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: |