From 6c39b01712ce178ca023d7c25e44cf232a641ea4 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sat, 8 Jun 2024 12:12:23 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=B7=B2=E5=AE=8C=E6=88=90=E8=AE=A2?= =?UTF-8?q?=E9=98=85=E6=B6=88=E6=81=AF=E6=8C=87=E5=AE=9A=E7=89=B9=E5=9C=B0?= =?UTF-8?q?=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/wechatforward/__init__.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/wechatforward/__init__.py b/plugins/wechatforward/__init__.py index 187840e..84d92ab 100644 --- a/plugins/wechatforward/__init__.py +++ b/plugins/wechatforward/__init__.py @@ -728,14 +728,15 @@ class WeChatForward(_PluginBase): or f"{subscribe.name} ({subscribe.year}) S{str(subscribe.season).rjust(2, '0')} 已完成订阅" == title: user_id = subscribe.username logger.info(f"{title} 获取到订阅用户 {user_id}") - - self.__send_image_message(title=title, - text=extra_msg, - userid=user_id, - access_token=access_token, - appid=wechat_appid, - image_url=subscribe.backdrop) - logger.info(f"{wechat_appid} 发送额外消息 {extra_msg} 成功") + if user_id and any(user_id == user for user in extra_userid.split(",")): + logger.info(f"{title} 消息用户 {user_id} 匹配到目标用户 {extra_userid}") + self.__send_image_message(title=title, + text=extra_msg, + userid=user_id, + access_token=access_token, + appid=wechat_appid, + image_url=subscribe.backdrop) + logger.info(f"{wechat_appid} 发送额外消息 {extra_msg} 成功") break else: # 搜索消息,获取消息text中的用户