调整代码

This commit is contained in:
liuwei
2025-04-23 17:14:37 +08:00
parent fc757151e4
commit 2a6b94980a
13 changed files with 308 additions and 12 deletions

View File

@@ -8,6 +8,7 @@ import xml.etree.ElementTree as ET
from gewechat.client import gewe_client
from gewechat.response.gewe_resp import GeweResponse
from gewechat.response.model.group.chatroom_member_detail import ChatroomMemberDetail
from plugin_common.message_plugin_interface import MessagePluginInterface
from plugin_common.plugin_interface import PluginStatus
from utils.robot_cmd.robot_command import Feature, PermissionStatus, GroupBotManager
@@ -122,13 +123,14 @@ class GroupMemberChangePlugin(MessagePluginInterface):
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
member_wxids = [wxid]
profile = gewe_client.client.get_chatroom_member_detail(gewe_client.client.app_id, member_wxids)
data = GeweResponse(profile).get_data()
gewe_client.client.post_link(gewe_client.client.app_id, sender,
title=f"👏欢迎 {nickname} 加入群聊!🎉",
description=f"⌚时间:{now}\n",
url="",
thumb_url=data[0].get("BigHeadImgUrl", ""))
profile: ChatroomMemberDetail = gewe_client.client.get_chatroom_member_detail(gewe_client.client.app_id,
member_wxids)
if profile.ret == 200:
gewe_client.client.post_link(gewe_client.client.app_id, sender,
title=f"👏欢迎 {nickname} 加入群聊!🎉",
description=f"⌚时间:{now}\n",
url="",
thumb_url=profile.data[0].big_head_img_url)
return True, "已发送进群欢迎语"
return False, "无需执行"