自动拨打微信电话
官方的已经有相关代码,可以自己添加具体地址为:
https://github.com/cluic/wxauto/pull/271/files
git 地址如下:
https://github.com/cluic/wxauto
示例代码
给“文件传输助手”发送消息
who = '文件传输助手'
msg = '''这是一条消息
wx.SendMsg(msg, who=who)
代码修改
在 wxauto.py 代码中 添加,就会给指定人拨打语音
##添加的 -
ele = self.ChatBox.PaneControl(searchDepth=8, foundIndex=2).ButtonControl(Name='语音聊天')
#ele = self.ChatBox.PaneControl(searchDepth=8, foundIndex=1).ButtonControl(Name='视频聊天')
try:
uia.SetGlobalSearchTimeout(1)
rect = ele.BoundingRectangle
Click(rect)
except:
return
finally:
uia.SetGlobalSearchTimeout(10)
####
具体位置在 函数 def SendMsg(self, msg, who=None, clear=True) 中,
wxauto.py 的250行开始