wechaty / python-wechaty

Python Wechaty is a Conversational RPA SDK for Chatbot Makers written in Python
https://wechaty.readthedocs.io/zh_CN/latest/
Apache License 2.0
1.62k stars 234 forks source link

[Bug]: ERROR - internal error 您好 上传文件可以接收能读到类型,但是保存不到本地 await msg.to_file_box() 是不是python这个方法不支持了 #423

Open lizihao001 opened 6 months ago

lizihao001 commented 6 months ago

Environment

if msg.type() == MessageType.MESSAGE_TYPE_ATTACHMENT:
            print(f'接收的文件类型: {msg.type()}')
            print(f'接收的文件类型:{msg.type()}准备下载文件...')

            file_box = await msg.to_file_box()
            print(f'文件名:{file_box.name}')
            file_path = f'D:\WorkSpace\wechaty_file/{file_box.name}'
            await file_box.to_file(file_path,True)
            print(f'文件保存路径:{file_path}')
else:
            print(f'3.13错误:{msg.type()}')
            print(f'错误:{traceback.print_exc()}')

Description

3.13错误:13
NoneType: None
错误:None
可以获取到文件类型 但是保存不到本地  不知是什么原因

Minimum reproducible code

NoneType: None await msg.to_file_box()方法 获取不到文件

lizihao001 commented 6 months ago

***解决一下呗

Carey8175 commented 5 months ago

问题解决了吗?我现在这个问题也解决不了

lizihao001 commented 5 months ago

个人微信和企业微信要分开的

---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2024年05月04日 16:21 | | 收件人 | wechaty/python-wechaty @.> | | 抄送人 | lizihao001 @.>, Author @.> | | 主题 | Re: [wechaty/python-wechaty] [Bug]: ERROR - internal error 您好 上传文件可以接收能读到类型,但是保存不到本地 await msg.to_file_box() 是不是python这个方法不支持了 (Issue #423) |

问题解决了吗?我现在这个问题也解决不了

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Carey8175 commented 5 months ago

我是个人微信,我将语音消息通过to_file_box会报错,2024-05-04 16:35:51,599 - Wechaty - ERROR - internal error <> 但是我看官方文档都是这么做的,我用的docker最新的wechaty,并且是padlocal协议。 感觉这个项目似乎被遗弃了已经

lizihao001 commented 5 months ago

应该是可以的,而且个人微信只能在个人微信的微信群里使用他接收不着企业微信的消息

---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2024年05月04日 16:42 | | 收件人 | wechaty/python-wechaty @.> | | 抄送人 | lizihao001 @.>, Author @.> | | 主题 | Re: [wechaty/python-wechaty] [Bug]: ERROR - internal error 您好 上传文件可以接收能读到类型,但是保存不到本地 await msg.to_file_box() 是不是python这个方法不支持了 (Issue #423) |

我是个人微信,我将语音消息通过to_file_box会报错,2024-05-04 16:35:51,599 - Wechaty - ERROR - internal error <> 但是我看官方文档都是这么做的,我用的docker最新的wechaty,并且是padlocal协议。 感觉这个项目似乎被遗弃了已经

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Carey8175 commented 5 months ago

我刚刚确定问题了,在1.2版本的docker中,语音保存文件就是会报错。我把docker切换到了0.65版本,就不会出现问题了

lizihao001 commented 5 months ago

是的,WeChaty版本最稳定的是0.65

---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2024年05月04日 16:49 | | 收件人 | wechaty/python-wechaty @.> | | 抄送人 | lizihao001 @.>, Author @.> | | 主题 | Re: [wechaty/python-wechaty] [Bug]: ERROR - internal error 您好 上传文件可以接收能读到类型,但是保存不到本地 await msg.to_file_box() 是不是python这个方法不支持了 (Issue #423) |

我刚刚确定问题了,在1.2版本的docker中,语音保存文件就是会报错。我把docker切换到了0.65版本,就不会出现问题了

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>