From a162ac33d210e782acebac9475e846e7b77fdd57 Mon Sep 17 00:00:00 2001 From: Kyomotoi <0w0@imki.moe> Date: Sat, 23 Jul 2022 14:42:28 +0800 Subject: =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E6=BD=9C=E5=9C=A8?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/plugins/anti_effort/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ATRI/plugins/anti_effort/__init__.py b/ATRI/plugins/anti_effort/__init__.py index c08dd3b..007ad6c 100644 --- a/ATRI/plugins/anti_effort/__init__.py +++ b/ATRI/plugins/anti_effort/__init__.py @@ -234,6 +234,9 @@ async def _(): bot = get_bot() for g in eb_g: + if not int(g): + continue + file_path = PLUGIN_DIR / f"{g}-ld.json" raw_data = json.loads(file_path.read_bytes()) data = raw_data["data"] @@ -246,5 +249,8 @@ async def _(): img = await AntiEffort().gen_img(winner_id, winner_nickname, coding_time) result = MessageSegment.image(img) - await bot.send_group_msg(group_id=g, message="昨日卷王已经产生!") - await bot.send_group_msg(group_id=g, message=Message(result)) + try: + await bot.send_group_msg(group_id=g, message="昨日卷王已经产生!") + await bot.send_group_msg(group_id=g, message=Message(result)) + except Exception: + continue -- cgit v1.2.3