python-wechaty
python-wechaty copied to clipboard
[Bug]: 图片无法接受和保存在本地
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}')