Skip to content

msg.download未实现无参数功能? #858

@tinunkai

Description

@tinunkai

文档中有提到msg.download可以无参数调用,直接返回二进制串,

如果你不需要下载到本地,仅想要读取二进制串进行进一步处理可以不传入参数,方法将会返回图片的二进制串。

@itchat.msg_register([PICTURE, RECORDING, ATTACHMENT, VIDEO])
def download_files(msg):
    with open(msg.fileName, 'wb') as f:
        f.write(msg.download())

然而似乎没有实现?

def download(self, fileName):

我试了一下也确实报错了。

TypeError: download() missing 1 required positional argument: 'fileName'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions