Comments (9)
可以参考这个代码
wechat_path = "D:\Program Files (x86)\Tencent\WeChat\WeChat.exe"
wechat = WeChat(wechat_path)
# 设置自动回复的间隔时间
interval = 10
# 设置自动回复的对象
auto_reply_names = set(["爸"])
wechat.set_auto_reply(auto_reply_names)
# 设置自动回复的内容
wechat.auto_reply_msg = "我现在有事不在,稍后回复。"
# 开启自动回复
while True:
wechat.check_new_msg(click_msg=True)
time.sleep(interval)
from easychat.
你好,我已经完善了自动回复的代码。
你可以通过检查ui_auto_wechat.py
文件里的check_new_msg
函数。这个函数支持自动检测新消息并根据设定的联系人列表来决定是否需要自动回复。
你可以通过自定义一个定时代码 (例如,每10分钟执行一次循环,调用check_new_msg
函数来自动回复新消息)。
有任何疑问欢迎进一步的交流!
from easychat.
您好,方便写一个例子吗?非常感谢
from easychat.
感谢作者
有个小问题就是如果 auto_reply_names 里面的 entry 在聊天框最上方的时候,double_click(chat_btn)
始终会使这个 entry 位于最上方,导致即使没有新消息的时候也会重复发送内容
不知道有没有办法来判断聊天头像的小红点来判定新消息?
from easychat.
你好,你可以尝试一下将check_new_msg()
中的click_msg
参数设置为True。经过测试我发现可能是有些消息如果不点击用户会一直卡顿。
from easychat.
你好,你可以尝试一下将
check_new_msg()
中的click_msg
参数设置为True。经过测试我发现可能是有些消息如果不点击用户会一直卡顿。
我用的是上面的示例代码 ,设置 click_msg=True 也没有办法解决。
这似乎是逻辑上的 bug:
假设聊天界面有 [A, B, C] 三个聊天,如果 auto_reply_names = [A]
,check_new_msg()
里面的 first_name
和 last_name
都会等于 A,这时双击聊天按键,第一条显示的还是 A,不论 A 是否有新消息,if item.Name in self.auto_reply_contacts
这条就都会被判中,发送回复消息。
一个临时的 workaround 是置顶一个不在 auto_reply_names
列表里的聊天窗口,这样双击聊天返回最上方时就能确保不会读到列表里面的项
from easychat.
你好,我刚刚也在检查这个问题。目前应该已经解决了。你可以重新下载一下ui_auto_wechat
文件,或者复制check_new_msg
这个函数再试一下。
from easychat.
emmm 似乎还是没有解决.... 我开个新的 issue 吧
from easychat.
嗯,可以的话麻烦给出一个可复现的例子我检查一下
from easychat.
Related Issues (20)
- 什么时候完善自动回复的功能哦? HOT 3
- 是否可以增加默认微信exe地址功能 HOT 1
- [已解决]显示发送失败 HOT 1
- 群发一千多人发现的问题 HOT 1
- 是基于视觉(截图分析)工作的吗?这样锁屏后无法用吧。。 HOT 3
- 当 set_auto_reply() 列表含有置顶聊天时,check_new_msg() 会重复发送回复消息 HOT 3
- 请问可以发送表情包吗 HOT 1
- get_contact 函数,如果好友昵称近似会出现的问题,见图 HOT 1
- 如何获取"服务通知"里面的内容? HOT 1
- exe文件点不开,弹窗 HOT 1
- 请问可以定时(每六分钟)发送指定消息去群里吗? HOT 1
- 在虚拟机中使用会出现一些问题 HOT 1
- 怎么实现在同一个聊天窗口一直自动回复就像qq那样 HOT 1
- 怎么知道微信客户端的界面结构 HOT 4
- 定时发送信息设置了时间没有发送 HOT 3
- 如何批量导入定时发送文本内容? HOT 1
- 请问,有封号风险吗? HOT 8
- 求添加新功能 HOT 3
- 可以修改一下最后点击回车发送文件而不是点击‘’发送‘’按钮发送吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easychat.