Skip to content

[Feature Request]Wechaty should support messagePreview #2479

@hcfw007

Description

@hcfw007

When receiving a mutil-media message, we may want to have a peek before we actually download the whole message.
e.g.
When receiving a file, we want to know its name and size to decided if we really need to download it or not.
When receiving a video, we want to just look at the thumbnail before we go through the whole video.

So introducing message.preview(), in my mind it looks like this:

async preview(): Promise<MessagePreviewObject> {}

interface MessagePreviewObject {
  fileMetadata?: FileMetadata | VideoMetadata | AudioMetadata,
}

interface FileMetadata {
  size?: number,
  name?: string,
}

interface VideoMetadata extends FileMetadata {
  duration?: number,
  height?: number,
  width?: number,
  thumbnail?: FileBox,
  thumbsize?: number,
  thumbwidth?: number,
  thumbheiht?: number,
}

interface AudioMetadata extends FileMetadata {
  duration?: number,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions