Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

388
Views
whatsapp-web.js, how do I send someone a contact card of someone else?

How do I send someone a contact card of someone else in whatsapp-web.js? Can I send a contact card when The person I send the contact card is saved on my phone but the contact I want to send is not on the contact list on my phone

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

client.on('ready', async () => {   try {
    console.log('Client is ready!');
    const saved = [];

    var array = fs.readFileSync('numb.txt').toString().split("\n"); //reading file
    for (i in array) {
      //console.log(array[i]);
      saved.push(array[i].substring(1)); //array with number 
    }

    const contacts = [];
    for (var i = 0; i < saved.length; i++) {
      contacts.push(await client.getContactById(saved[i] + '@c.us')); }
    client.sendMessage(to, contacts); //sending contact cards   
} });
about 4 years ago · Juan Pablo Isaza Report

0

you can send it by sending vcard as text message.

Example:

client.on('ready', async () => {
    client.sendMessage(
        '1234567890@c.us', 
        'BEGIN:VCARD
          ....(vcarddata)....
        END:VCARD', 
        {'parseVCards':true}) // by default its true
     .then(...).catch(...);
});

VCard will be parsed and made contact by parseVCard option.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!