[GH-ISSUE #7] onMessageReceived from iphone users #6

Closed
opened 2026-02-27 10:25:20 +03:00 by kerem · 7 comments
Owner

Originally created by @MateoMax-hub on GitHub (Jul 13, 2023).
Original GitHub issue: https://github.com/mimamch/wa-multi-session/issues/7

hi i was making a simple app to responde msg automatically and notice that when an iphone user sends me a msg i don't receive the content of the message anywhere, this is the code
whatsapp.onMessageReceived(async (msg) => { console.log(New Message =>, msg);

and this is the log from iphone users
New Message => { key: { remoteJid: ****@s.whatsapp.net', fromMe: false, id: '****', participant: undefined }, messageTimestamp: 1689286004, pushName: '****', broadcast: false, messageStubType: 2, messageStubParameters: [ 'Bad MAC' ], sessionId: 'qeso', saveImage: [Function (anonymous)], saveVideo: [Function (anonymous)], saveDocument: [Function (anonymous)] }
i replaced some private data with "****"
am i doing something wrong? is this fixeable? thanks in advance

with not iphone users i found the content of the message in msg.message.conversation

if the iphone user send a msg on a gruop chat im able to see the content but not on private chats

ex of the log when iphone user send msg on a group

New Message => { key: { remoteJid: '****@g.us', fromMe: false, id: '****', participant: '****@s.whatsapp.net' }, messageTimestamp: 1689286637, pushName: '****', broadcast: false, message: Message { senderKeyDistributionMessage: SenderKeyDistributionMessage { groupId: '****@g.us', axolotlSenderKeyDistributionMessage: [Uint8Array] }, extendedTextMessage: ExtendedTextMessage { text: 'TEXT HERE', contextInfo: [ContextInfo] }, messageContextInfo: MessageContextInfo { deviceListMetadata: [DeviceListMetadata], deviceListMetadataVersion: 2 } }, sessionId: 'qeso', saveImage: [Function (anonymous)], saveVideo: [Function (anonymous)], saveDocument: [Function (anonymous)] }

Originally created by @MateoMax-hub on GitHub (Jul 13, 2023). Original GitHub issue: https://github.com/mimamch/wa-multi-session/issues/7 hi i was making a simple app to responde msg automatically and notice that when an iphone user sends me a msg i don't receive the content of the message anywhere, this is the code `whatsapp.onMessageReceived(async (msg) => { console.log(`New Message =>`, msg);` and this is the log from iphone users `New Message => { key: { remoteJid: ****@s.whatsapp.net', fromMe: false, id: '****', participant: undefined }, messageTimestamp: 1689286004, pushName: '****', broadcast: false, messageStubType: 2, messageStubParameters: [ 'Bad MAC' ], sessionId: 'qeso', saveImage: [Function (anonymous)], saveVideo: [Function (anonymous)], saveDocument: [Function (anonymous)] }` i replaced some private data with "****" am i doing something wrong? is this fixeable? thanks in advance with not iphone users i found the content of the message in msg.message.conversation if the iphone user send a msg on a gruop chat im able to see the content but not on private chats ex of the log when iphone user send msg on a group `New Message => { key: { remoteJid: '****@g.us', fromMe: false, id: '****', participant: '****@s.whatsapp.net' }, messageTimestamp: 1689286637, pushName: '****', broadcast: false, message: Message { senderKeyDistributionMessage: SenderKeyDistributionMessage { groupId: '****@g.us', axolotlSenderKeyDistributionMessage: [Uint8Array] }, extendedTextMessage: ExtendedTextMessage { text: 'TEXT HERE', contextInfo: [ContextInfo] }, messageContextInfo: MessageContextInfo { deviceListMetadata: [DeviceListMetadata], deviceListMetadataVersion: 2 } }, sessionId: 'qeso', saveImage: [Function (anonymous)], saveVideo: [Function (anonymous)], saveDocument: [Function (anonymous)] }`
kerem closed this issue 2026-02-27 10:25:20 +03:00
Author
Owner

@mimamch commented on GitHub (Jul 13, 2023):

I never know there an issue with message from iphone device, but let's check it out

Caption for message will different sometimes so I create this function to parsing it from msg object:

const getMessageCaption = (msg: wa.MessageReceived): string => { return ( msg.message?.conversation || msg.message?.imageMessage?.caption || msg.message?.videoMessage?.caption || msg.message?.documentMessage?.caption || msg.message?.extendedTextMessage?.text || "" ); };

<!-- gh-comment-id:1635050598 --> @mimamch commented on GitHub (Jul 13, 2023): I never know there an issue with message from iphone device, but let's check it out Caption for message will different sometimes so I create this function to parsing it from msg object: `const getMessageCaption = (msg: wa.MessageReceived): string => { return ( msg.message?.conversation || msg.message?.imageMessage?.caption || msg.message?.videoMessage?.caption || msg.message?.documentMessage?.caption || msg.message?.extendedTextMessage?.text || "" ); };`
Author
Owner

@MateoMax-hub commented on GitHub (Jul 15, 2023):

if you need more context of my code to reproduce the bug let me know, i'm very interested in this library and it's potential, i will try using that parser and see if something change

<!-- gh-comment-id:1636572800 --> @MateoMax-hub commented on GitHub (Jul 15, 2023): if you need more context of my code to reproduce the bug let me know, i'm very interested in this library and it's potential, i will try using that parser and see if something change
Author
Owner

@MateoMax-hub commented on GitHub (Jul 15, 2023):

i just saw that today i'm receiving the msg from iphone users as expected, i don't see any reason for a change... i don't update anything in my code since my last comment here

<!-- gh-comment-id:1636577401 --> @MateoMax-hub commented on GitHub (Jul 15, 2023): i just saw that today i'm receiving the msg from iphone users as expected, i don't see any reason for a change... i don't update anything in my code since my last comment here
Author
Owner

@mimamch commented on GitHub (Jul 15, 2023):

Some spesific case may cause some unknown bug 💨

<!-- gh-comment-id:1636583077 --> @mimamch commented on GitHub (Jul 15, 2023): Some spesific case may cause some unknown bug 💨
Author
Owner

@MateoMax-hub commented on GitHub (Jul 24, 2023):

i'm srry i don't know if the correct thing to do is open a new issue or just ask here,

i need an instance where i can see when i put a label on a chat in whatsapp business, if it's not created i will try make one based on your repository for personal use, if you want too i will create a pull request so you can add that feature here too, let me know if there is any function to achieve my goal @mimamch

<!-- gh-comment-id:1648236204 --> @MateoMax-hub commented on GitHub (Jul 24, 2023): i'm srry i don't know if the correct thing to do is open a new issue or just ask here, i need an instance where i can see when i put a label on a chat in whatsapp business, if it's not created i will try make one based on your repository for personal use, if you want too i will create a pull request so you can add that feature here too, let me know if there is any function to achieve my goal @mimamch
Author
Owner

@MateoMax-hub commented on GitHub (Jul 24, 2023):

i already confirm that in the socket/index.js file you start a socket a receive every event that occurs in the session, and also when labels are assigned to chats so i can make a listener for that specific event, i will clone or fork the repository to make the changes i need for my personal use, let me know if you want me to make pull request of that feature to add it to your project

<!-- gh-comment-id:1648243722 --> @MateoMax-hub commented on GitHub (Jul 24, 2023): i already confirm that in the socket/index.js file you start a socket a receive every event that occurs in the session, and also when labels are assigned to chats so i can make a listener for that specific event, i will clone or fork the repository to make the changes i need for my personal use, let me know if you want me to make pull request of that feature to add it to your project
Author
Owner

@mimamch commented on GitHub (Jul 24, 2023):

That's great, currently we are do not have that feature.

Maybe you can use this reference to creating labels feature https://github.com/WhiskeySockets/Baileys/pull/69

<!-- gh-comment-id:1648250587 --> @mimamch commented on GitHub (Jul 24, 2023): That's great, currently we are do not have that feature. Maybe you can use this reference to creating labels feature https://github.com/WhiskeySockets/Baileys/pull/69
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wa-multi-session-mimamch#6
No description provided.