mirror of
https://github.com/mimamch/wa-multi-session.git
synced 2026-04-25 08:45:59 +03:00
[GH-ISSUE #7] onMessageReceived from iphone users #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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)] }@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 || "" ); };@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
@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
@mimamch commented on GitHub (Jul 15, 2023):
Some spesific case may cause some unknown bug 💨
@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
@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
@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