MCPcopy
hub / github.com/cluic/wxauto / GetGroupMembers

Method GetGroupMembers

wxauto/elements.py:369–399  ·  view source on GitHub ↗

获取当前聊天群成员 Returns: list: 当前聊天群成员列表

(self)

Source from the content-addressed store, hash-verified

367 return isload
368
369 def GetGroupMembers(self):
370 """获取当前聊天群成员
371
372 Returns:
373 list: 当前聊天群成员列表
374 """
375 wxlog.debug(f"获取当前聊天群成员:{self.who}")
376 ele = self.UiaAPI.PaneControl(searchDepth=7, foundIndex=6).ButtonControl(Name='聊天信息')
377 try:
378 uia.SetGlobalSearchTimeout(1)
379 rect = ele.BoundingRectangle
380 Click(rect)
381 except:
382 return
383 finally:
384 uia.SetGlobalSearchTimeout(10)
385 roominfoWnd = self.UiaAPI.WindowControl(ClassName='SessionChatRoomDetailWnd', searchDepth=1)
386 more = roominfoWnd.ButtonControl(Name='查看更多', searchDepth=8)
387 try:
388 uia.SetGlobalSearchTimeout(1)
389 rect = more.BoundingRectangle
390 Click(rect)
391 except:
392 pass
393 finally:
394 uia.SetGlobalSearchTimeout(10)
395 members = [i.Name for i in roominfoWnd.ListControl(Name='聊天成员').GetChildren()]
396 while members[-1] in ['添加', '移出']:
397 members = members[:-1]
398 roominfoWnd.SendKeys('{Esc}')
399 return members
400
401class WeChatImage:
402 def __init__(self, language='cn') -> None:

Callers

nothing calls this directly

Calls 7

ButtonControlMethod · 0.80
PaneControlMethod · 0.80
WindowControlMethod · 0.80
ListControlMethod · 0.80
SendKeysMethod · 0.80
ClickFunction · 0.70
GetChildrenMethod · 0.45

Tested by

no test coverage detected