summaryrefslogtreecommitdiff
path: root/ATRI/plugins
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2022-07-23 14:42:28 +0800
committerKyomotoi <[email protected]>2022-07-23 14:42:28 +0800
commita162ac33d210e782acebac9475e846e7b77fdd57 (patch)
tree660be33a12500948288f71346883d4c45aaa0212 /ATRI/plugins
parent5b157a768ad101ad07cb8311d87e81fa8f1d027a (diff)
downloadATRI-a162ac33d210e782acebac9475e846e7b77fdd57.tar.gz
ATRI-a162ac33d210e782acebac9475e846e7b77fdd57.tar.bz2
ATRI-a162ac33d210e782acebac9475e846e7b77fdd57.zip
🐛 修复潜在的bug
Diffstat (limited to 'ATRI/plugins')
-rw-r--r--ATRI/plugins/anti_effort/__init__.py10
1 files 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