whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

Media message in the channel has hasMedia: false

Open TheMacros opened this issue 10 months ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

When receiving the message with media in the channel, the Message object has hasMedia property equal to false, also the mediaKey equals null, but the type property equals image.

Expected behavior

hasMedia should be true and the other related props should not be null

Steps to Reproduce the Bug or Issue

  1. subscribe to a channel with WhatsApp app
  2. subscribe to message events with whatsapp-web.js
  3. send an image to the WhatsApp channel you subscribed

Relevant Code

Here is an example of a Message object I receive:

[
    '_data' => [
        ...
        'body' => '/9j/4AAQSkZJRgABAQA.....P//+AAMA/9k='
        'type' => 'image'
        'directPath' => '/m1/v/t24/An9rC4V34.....&_nc_sid=5e03e0'
        'mimetype' => 'image/jpeg'
        'filehash' => 'rYozqfT03uvcbamYnqPIwYNCuycw4yTEEnLRAvK5Y1Y='
        'size' => 126282
        'mediaKey' => null
        'mediaKeyTimestamp' => null
        ...
    ],
    ...
    'mediaKey' => null
    'id' => [
        'fromMe' => false
        'remote' => '1203632.....36578@newsletter'
        'id' => '3A74858C......B1F12'
        '_serialized' => 'false_120363.....6578@newsletter_3A74858C.....B1F12'
    ]
    'ack' => 1
    'hasMedia' => false
    'body' => '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABsSFBcU....rqe0IzNTP//+AAMA/9k='
    'type' => 'image'
    ...
]

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS: Linux Phone OS: iOS whatsapp-web.js version: webpack-exodus WhatsApp Web version: 2.3000.1012737330 Node: 17.0.1

Additional context

No response

TheMacros avatar Apr 13 '24 09:04 TheMacros