GithubHelp home page GithubHelp logo

lich0821 / wechatrobot Goto Github PK

View Code? Open in Web Editor NEW
984.0 17.0 214.0 13.19 MB

微信机器人,接入Gemini、ChatGPT、ChatGLM、讯飞星火、Tigerbot;成语接龙、天气预报、新闻摘要、定时任务。

License: MIT License

Python 100.00%
chatgpt python wechat chatglm gemini xunfei

wechatrobot's Issues

[优化] 优化下 /text 接口,谢谢

描述这个 bug

对 bug 作一个清晰简明的描述:

  • 想做什么?
    调用 wcfhttp 里面发送文本消息的 /text 接口。

  • 现在怎么做?
    这是我的数据格式
    {
    "msg": "689789 @",
    "receiver": "xxxxx@chatroom",
    "aters": "xxx1111"
    }

  • 遇到什么问题?
    我上面返回的数据是 689789 @,我希望变成 689789 @张三
    希望优化下 msg 发送的格式,你 py 里面 sendTextMsg 已经查询过群成员昵称了,是不是可以直接帮我拼接到 msg 里面,不然我还要自己再查询一次群成员昵称,拼接在 msg 后面,然后再调用 /text 接口

使用环境(请补全下列信息):

  • 操作系统:Windows Server 2008 64 位
  • 微信版本:3.9.2.23
  • Python 版本:3.10.11

能拿到微信客户端的二维码图片吗

感谢作者提供如此优秀的工具,请问能拿到微信客户端的二维码图片吗,还有能解密OpenIMContact.db吗,企业微信来的消息或人员获取还有点问题

运行python main.py时提示连接失败

描述这个 bug
对 bug 作一个清晰简明的描述:运行python main.py时提示连接失败

  • 想做什么?
  • 现在怎么做?
  • 遇到什么问题?
    微信版本:
    3.9.2.23
    wcf.txt
    [2024-05-29 14:15:00.744] [debug] [WCF] [log.cpp::33::InitLogger] InitLogger with debug level
    [2024-05-29 14:15:00.745] [error] [WCF] [spy.cpp::27::InitSpy] 获取微信版本失败

python main.py
2024-05-29 14:14:58 wcferry version: 39.0.14.1
2024-05-29 14:15:02 连接失败: Connection refused

使用环境(请补全下列信息):

  • 操作系统:【Windows 10】
  • 操作系统版本:【64 位】
  • Python 版本 【3.11 64位】

屏幕截图
添加屏幕截图以帮助解释您的问题。(可选)

[💡SUG] 发送视频时,添加变量控制是否勾选原画

你希望添加的功能是否与某个问题相关?
当 [我接收到机器人发送的视频] 时,点开视频总是压缩画质,需要点击“查看原视频”,很不方便。

描述你希望的解决方案
单独设置变量控制是否勾选原画,或者不切实际一点,直接发送原画,但接收方不显示“查看原视频”(将原画视频替换掉压缩视频后发送?)

描述你考虑的替代方案
直接发送压缩后的视频,即不勾选原画。

其他

chatglm3 代码模式生成了爱心图片,但不能发送到微信

chatglm3代码模式,生成了爱心,但结果图片没有发送到微信,只提示:这就是一个爱心形状的图形。希望你会喜欢!如果你有其他要求或需要进一步的调整,请告诉我。

这是为什么?我看了目录也生成了照片,就是没有回复到微信中。

请大神指点。

[🐛BUG] 运行一段时间后,不接收消息了

描述这个 bug
对 bug 作一个清晰简明的描述:

  • 想一直运行,根据接收到的消息 自动回复消息
  • 运行一段时间后,不接受消息了

使用环境(请补全下列信息):

  • 操作系统:windows server 2022 datacenter (阿里的云电脑)
  • 操作系统版本:64 位
  • Python 版本: 3.11.0

屏幕截图
image

运行一段时候后,不打印这个日志了

    def enableReceivingMsg(self) -> None:
        def innerProcessMsg(wcf: Wcf):
            while wcf.is_receiving_msg():
                now_time = str(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
                print(f"{now_time}【等待消息】************************")
                try:
                    msg = wcf.get_msg()
                    if msg.roomid and msg.roomid not in self.config.GROUPS:
                        self.all_room.update({msg.roomid: "未知"})
                        with open("room/all_room.json", "w") as f:
                            f.write(json.dumps(self.all_room))
                        return
                    self.LOG.info(f"msg:roomid: {msg.roomid}, sender: {msg.sender}, content: {msg.content}")

                    flag = self.baseFunc.manage_command(msg, self)  # 首先执行管理指令
                    self.LOG.info(f"【管理指令】是否是管理执行指令 {flag}")
                    if not flag:
                        self.processMsg(msg)
                    # self.processMsg(msg)
                except Empty:
                    now_time = str(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
                    print(f"{now_time}【空消息】!!!!!!!!!!!!!! ")
                    continue  # Empty message
                except Exception as e:
                    traceback.print_exc()
                    self.LOG.error(f"Receiving message error: {e}")

        self.wcf.enable_receiving_msg()
        Thread(target=innerProcessMsg, name="GetMessage", args=(self.wcf,), daemon=True).start()

最开始就发现这个问题,然后在群里也有其他人遇到,群友他自己 print 打印日志后就咩有这个问题,但是我依旧存在这个问题

然后我就想看看运行的多线程情况,如下图

image

图上半截是正常运行的,下半截是不接受消息时的,线程丢失了

关于chatgpt

如果我想接入chatgpt,该如何去抓取我账号里的那些参数
可不可以直接用本地的电脑开启v2使用国外的代理,然后不填proxy的参数啊

[🐛BUG] go版本调用/ai ,程序报错闪退

描述这个 bug
对 bug 作一个清晰简明的描述:

  • 想做什么?
    接入ai聊天到微信群
  • 现在怎么做?
  • 遇到什么问题?

使用环境(请补全下列信息):

  • 操作系统:win11
  • 操作系统版本:【 64 位】

屏幕截图
c2b9bc0af7589b2e779a77559f3ee3d

[🐛BUG] win10上运行时微信崩溃退出

描述这个 bug
微信3.7.0.30,登录后,执行python main.py,微信崩溃退出。试过几次都是崩溃。

使用环境(请补全下列信息):

  • Windows 10 64位 专业版 22H2 19045.2604
  • Python 10.10 64位

崩溃信息
请见附件

*另外,在win11上第一次运行崩溃退出,再次运行却可以了。以下是win10出错时系统自动给出的log文件

WeChat9cef1c2.zip

[🐛BUG] 用一句话描述您的问题。

描述这个 bug
对 bug 作一个清晰简明的描述。

使用环境(请补全下列信息):

  • 操作系统:【如 Windows 7, Windows 10, Windows Server 2008 等】
  • 操作系统版本:[32 位 或 64 位】
  • Python 版本 【如 3.7.9 32位, 3.8.15 64位 等】

屏幕截图
添加屏幕截图以帮助解释您的问题。(可选)

崩溃信息
微信崩溃原因描述文件内容。(可选)

想进群学习,老兄。

[🐛BUG] Google Gemini模型没有正确识别提示词来运行

描述这个 bug
对 bug 作一个清晰简明的描述:
这个bug来自于Google Gemini模型,它并没有正确的识别到提示词,它认为“我是 Gemini,是 Google 开发的多模态 AI 语言模型。”
我在提示词的地方正确设置了,可是它似乎没有正确的生效?
具体可以查看屏幕截图
如果需要作者可以联系我[email protected]

使用环境(请补全下列信息):

  • 操作系统:Windows Server 2012R2【如 Windows 7, Windows 10, Windows Server 2008 等】
  • 操作系统版本:64 位【32 位或 64 位】
  • Python 版本:3.10.11【如 3.7.9 32 位,3.8.15 64 位 等】

屏幕截图
添加屏幕截图以帮助解释您的问题。(可选)
image
image
image

[🐛BUG] 用一句话描述您的问题。

使用环境(请补全下列信息):

  • 操作系统:【Windows Server 2008 】
  • 操作系统版本:【 64 位】
  • Python 版本 【3.10】

描述这个 bug
google gemini的API接口调用失败

  • 访问python sdk遇到问题

Traceback (most recent call last):
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\google\api_core\grpc_helpers.py", line 79, in error_remapped_callable
return callable_(*args, **kwargs)
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\grpc_channel.py", line 1160, in call
return _end_unary_response_blocking(state, call, False, None)
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\grpc_channel.py", line 1003, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:172.217.160.106:443: socket is null"
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2023-12-16T00:55:14.7024441+00:00", grpc_status:14, grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:172.217.160.106:443: socket is null"}"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\google\api_core\retry.py", line 207, in retry_target
result = target()
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\google\api_core\timeout.py", line 120, in func_with_timeout
return func(*args, **kwargs)
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\google\api_core\grpc_helpers.py", line 81, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.ServiceUnavailable: 503 failed to connect to all addresses; last error: UNKNOWN: ipv4:172.217.160.106:443: socket is null

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\Python\wechat\new\WeChatRobot\test_gemini.py", line 9, in
response = model.generate_content("The opposite of hot is")
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\google\generativeai\generative_models.py", line 243, in generate_content
response = self._client.generate_content(request)
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\google\ai\generativelanguage_v1beta\services\generative_service\client.py", line 566, in generate_content
response = rpc(
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\google\api_core\gapic_v1\method.py", line 131, in call
return wrapped_func(*args, **kwargs)
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\google\api_core\retry.py", line 372, in retry_wrapped_func
return retry_target(
File "D:\Python\wechat\new\WeChatRobot\venv\lib\site-packages\google\api_core\retry.py", line 226, in retry_target
raise exceptions.RetryError(
google.api_core.exceptions.RetryError: Deadline of 60.0s exceeded while calling target function, last exception: 503 failed to connect to all addresses; last error: UNKNOWN: ipv4:172.217.160.106:443: socket is null

如何指定ChatGPT的Model?

例如我希望使用3.5-turbo-16k,或者gpt4的接口,但是默认他调用的模型太老了,数据仅停留在2020年

[🐛BUG] 被微信封号的概率有多高

描述这个 bug
对 bug 作一个清晰简明的描述。

使用环境(请补全下列信息):

  • 操作系统:【如 Windows 7, Windows 10, Windows Server 2008 等】
  • 操作系统版本:[32 位 或 64 位】
  • Python 版本 【如 3.7.9 32位, 3.8.15 64位 等】

屏幕截图
添加屏幕截图以帮助解释您的问题。(可选)

崩溃信息
微信崩溃原因描述文件内容。(可选)

在ubuntu环境下运行出现错误

Linux环境1 wsl ubuntu 22.04
Linux环境2 ubuntu 22.04 物理机
python版本 3.10.6

windows环境 windows11
python版本 3.10.7

Win环境下运行正常

Linux环境下报错:

3d6193f1fdf811d8e2ee4a63adc092b

经测试,在WSL和物理机Linux 下报一样的错误,WIN下正常

请问有工作日定时提醒发送消息的功能吗?

工作日定时发送自定义消息的功能。
还有请问下,为什么天气预报功能不能正常使用(时间不对),是因为我接入的是chatgpt3.5吗? 如果要正常使用是不是需要接入chatgpt4.0?

[🐛BUG] 配置 bard 响应超时。

配置 bard 之后, 报超时error, 已开启vpn, 网页端 Gemini 可用

使用环境(请补全下列信息):

  • 操作系统:Windows 11 22621.3155
  • 操作系统版本:【64 位】
  • Python 版本 【Python 3.12.1 64 位 】

屏幕截图

image
image

[💡SUG] 提允许通过配置特定的wxid来自动屏蔽或忽视来自这些wxid的对话请求,以减少不必要的干扰。

问题背景: 在管理用户请求的系统中,某些用户可能因为各种原因需要被临时或永久屏蔽对话请求。比如,滥用服务、发送垃圾信息等行为。目前,系统缺乏直接通过用户的微信ID来快速屏蔽对话请求的功能。

期望的解决方案: 实现一个功能,让管理员或系统维护者能通过添加用户的微信ID到一个黑名单中,来自动屏蔽或忽略这些用户的对话请求。这个功能应该包括:

一个界面或命令行工具,用于输入需要屏蔽的用户wxid。
一个黑名单数据库或列表,存储被屏蔽用户的wxid。
一个逻辑判断机制,在接收到用户请求时检查其wxid是否在黑名单中。
如果用户的wxid在黑名单中,则自动忽略或拒绝其对话请求,可能伴随一条通知消息告知用户。
考虑的替代方案:

基于用户行为的自动屏蔽: 系统根据用户的行为自动判断是否需要屏蔽,如发送消息频率、内容质量等指标。
举报机制: 允许其他用户举报不当行为,当举报达到一定数量时自动触发屏蔽逻辑。
时间限制屏蔽: 不是永久屏蔽用户wxid,而是给予一定时间的禁言或屏蔽,过后自动解除。

[🐛BUG] 群里拷贝@消息修改后发送,msg.is_at(self.wxid)接口识别为非群@消息。

描述这个 bug
对 bug 作一个清晰简明的描述。
群里直接拷贝@消息后发送,processMsg函数中调用msg.is_at(self.wxid)接口识别为非群@消息。
使用环境(请补全下列信息):

  • 操作系统:【如 Windows 7, Windows 10, Windows Server 2008 等】
  • 操作系统版本:[32 位 或 64 位】
  • Python 版本 【如 3.7.9 32位, 3.8.15 64位 等】

屏幕截图
添加屏幕截图以帮助解释您的问题。(可选)

崩溃信息
微信崩溃原因描述文件内容。(可选)

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.