Git Product home page Git Product logo

Comments (9)

LTEnjoy avatar LTEnjoy commented on September 15, 2024 4

可以参考这个代码

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.

LTEnjoy avatar LTEnjoy commented on September 15, 2024

你好,我已经完善了自动回复的代码。

你可以通过检查ui_auto_wechat.py文件里的check_new_msg函数。这个函数支持自动检测新消息并根据设定的联系人列表来决定是否需要自动回复。

你可以通过自定义一个定时代码 (例如,每10分钟执行一次循环,调用check_new_msg函数来自动回复新消息)。

有任何疑问欢迎进一步的交流!

from easychat.

diguawl avatar diguawl commented on September 15, 2024

您好,方便写一个例子吗?非常感谢

from easychat.

T-K-233 avatar T-K-233 commented on September 15, 2024

感谢作者

有个小问题就是如果 auto_reply_names 里面的 entry 在聊天框最上方的时候,double_click(chat_btn) 始终会使这个 entry 位于最上方,导致即使没有新消息的时候也会重复发送内容

不知道有没有办法来判断聊天头像的小红点来判定新消息?

from easychat.

LTEnjoy avatar LTEnjoy commented on September 15, 2024

你好,你可以尝试一下将check_new_msg()中的click_msg参数设置为True。经过测试我发现可能是有些消息如果不点击用户会一直卡顿。

from easychat.

T-K-233 avatar T-K-233 commented on September 15, 2024

你好,你可以尝试一下将check_new_msg()中的click_msg参数设置为True。经过测试我发现可能是有些消息如果不点击用户会一直卡顿。

我用的是上面的示例代码 ,设置 click_msg=True 也没有办法解决。

这似乎是逻辑上的 bug:
假设聊天界面有 [A, B, C] 三个聊天,如果 auto_reply_names = [A]check_new_msg() 里面的 first_namelast_name 都会等于 A,这时双击聊天按键,第一条显示的还是 A,不论 A 是否有新消息,if item.Name in self.auto_reply_contacts 这条就都会被判中,发送回复消息。

一个临时的 workaround 是置顶一个不在 auto_reply_names 列表里的聊天窗口,这样双击聊天返回最上方时就能确保不会读到列表里面的项

from easychat.

LTEnjoy avatar LTEnjoy commented on September 15, 2024

你好,我刚刚也在检查这个问题。目前应该已经解决了。你可以重新下载一下ui_auto_wechat文件,或者复制check_new_msg这个函数再试一下。

from easychat.

T-K-233 avatar T-K-233 commented on September 15, 2024

emmm 似乎还是没有解决.... 我开个新的 issue 吧

from easychat.

LTEnjoy avatar LTEnjoy commented on September 15, 2024

嗯,可以的话麻烦给出一个可复现的例子我检查一下

from easychat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.