Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 图片无法接受和保存在本地 #409

Open
ashen001 opened this issue Jul 1, 2023 · 0 comments
Open

[Bug]: 图片无法接受和保存在本地 #409

ashen001 opened this issue Jul 1, 2023 · 0 comments

Comments

@ashen001
Copy link

ashen001 commented Jul 1, 2023

Environment

- wechaty:0.10.7
- wechaty-puppet:
- wechaty-puppet-service: 
- wechaty-plugin-contrib: 
- token type: padlocal
- the version of wechaty docker container: [0.68]

Description

昨天晚上还是好的。今天发现图片无法保存在本地了。发送图片就显示internal error <>错误。。

Minimum reproducible code

        elif msg.type()==Message.Type.MESSAGE_TYPE_IMAGE:
            img = await msg.to_file_box()
            say_time=time.strptime(str(msg.date()), '%Y-%m-%d %H:%M:%S')
            say_timestamp = str(time.mktime(say_time)).split('.')[0]

            sr = SystemRandom()
            n = sr.choice(range(1000, 10000))
            pin = format(n, '04')

            img_name=f'{say_timestamp}_{pin}.jpg'

            print(img_name)
            await img.to_file(f'img/{img_name}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant