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

收到附件后,执行 msg.toFileBox,文件里无论是buffer 还是 stream 都是undefined #196

Open
danni-cool opened this issue Dec 3, 2023 · 0 comments

Comments

@danni-cool
Copy link
Member

danni-cool commented Dec 3, 2023

业务代码

  switch (msg.type()) {
    case 1: // 附件
    case 2: // 语音
    case 6: // 图片
    case 15: {
      // 视频
      const steamFile = await msg.toFileBox()
      const type = await fileTypeFromBuffer(
        steamFile.buffer || steamFile.stream,
      )

实际 steamFile 内容

{
  version: "1.4.15",
  _type: 5,
  _size: 21386,
  mimeType: "application/unknown",
  _mediaType: "text/csv",
  _name: "123.csv",
  _metadata: undefined,
  base64: undefined,
  remoteUrl: undefined,
  qrCode: undefined,
  uuid: undefined,
  buffer: undefined,
  localPath: "C:\\Document\\WeChat Files\\wxid_wwqi157cAlfj42\\FileStorage\\File\\2023-12\\123.csv",
  stream: undefined,
  headers: undefined,
}
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