调整代码
This commit is contained in:
@@ -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, "无需执行"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user