From 87c59a03358a143912f827f5de56dd958421d44a Mon Sep 17 00:00:00 2001 From: "Mr.Xia" <1424473282@qq.com> Date: Mon, 14 Sep 2026 11:40:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(help):=20=E4=B8=A5=E6=A0=BC=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E8=8D=89=E7=A8=BF(draft)=E3=80=81=E5=B7=B2=E7=BB=93?= =?UTF-8?q?=E6=9D=9F(ended)=E5=8F=8A=E5=B7=B2=E6=9A=82=E5=81=9C(paused)?= =?UTF-8?q?=E7=9A=84=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- danding_bot/plugins/danding_help/help.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/danding_bot/plugins/danding_help/help.py b/danding_bot/plugins/danding_help/help.py index 26d2aa9..a8166e5 100644 --- a/danding_bot/plugins/danding_help/help.py +++ b/danding_bot/plugins/danding_help/help.py @@ -129,12 +129,25 @@ async def _handle_activity(bot: V11Bot, event: GroupMessageEvent): await activity.finish(plugin_config.NoActivityStr) return - poster_items = [it for it in items if it.get("poster_url") or it.get("poster_path")] + # 严格过滤出处于发布状态且未结束的活动,排除草稿(draft)、已结束(ended)、已暂停(paused) + valid_items = [] + for it in items: + lifecycle = str(it.get("lifecycle") or "").lower() + pub_status = str(it.get("publication_status") or "").lower() + if lifecycle == "ended" or pub_status in ("draft", "archived", "paused"): + continue + valid_items.append(it) + + if not valid_items: + await activity.finish(plugin_config.NoActivityStr) + return + + poster_items = [it for it in valid_items if it.get("poster_url") or it.get("poster_path")] # 无海报时回退为文字列表 if not poster_items: msg_lines = ["📢 当前运营活动:"] - for it in items: + for it in valid_items: name = it.get("活动名", "未知活动") start = it.get("活动开始时间", "") end = it.get("活动截止时间", "")