You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on the vcard string, "N" should be used instead of "FN" (It also helps to exemplify that using semi-colons, one can send first name and last name for the whatsapp app to reccognize)
on the message data itself, displayName should be inside the vcard object inside of the array of contacts.
Here's the working code:
const vcard = 'BEGIN:VCARD\n' // metadata of the contact card
+ 'VERSION:3.0\n'
+ 'N:Singh;Jeff \n' // full name
+ 'ORG:Ashoka Uni;\n' // the organization of the contact
+ 'TEL;type=CELL;type=VOICE;waid=911234567890:+91 12345 67890\n' // WhatsApp ID + phone number
+ 'END:VCARD'
const sentMsg = await sock.sendMessage(
id,
{
contacts: {
contacts: [{ displayName: 'Jeff', vcard }]
}
}
)
What fails:
If you follow the sample code in the readme, the card is sent to the user with a generic "Contact" display name. Also, the name is not displayed in the contact card
Thanks
The text was updated successfully, but these errors were encountered:
The README is wrong on the contactMessage data structure.
https://github.com/WhiskeySockets/Baileys?tab=readme-ov-file#non-media-messages
Two changes needed:
Here's the working code:
What fails:
Thanks
The text was updated successfully, but these errors were encountered: