This commit is contained in:
aaron 2025-03-03 08:44:42 +08:00
parent 8472d79279
commit 63c16b7a6e

View File

@ -122,13 +122,14 @@ async def wechat_corp_callback(
if event == 'change_external_chat':
chat_id = msg_root.find('ChatId').text
change_type = msg_root.find('ChangeType').text
update_detail = msg_root.find('UpdateDetail')
# 处理进群事件
if change_type == 'add_member':
userid = msg_root.find('UserId').text
if update_detail == 'add_member':
userid = msg_root.find('MemChangeList')[0].find('Item').text
unionid = await wecom_client.get_unionid_from_userid(userid)
print(f"根据userid获取unionid结果: {unionid}")
return Response(content="success", media_type="text/plain")