0

I'm able to send messages to a number using the contact ID but I want to send to a group chat and don't know how to.

client.on('ready', () => {

 console.log('Client is ready!');

  // Number where you want to send the message.

 const number = "+911234567890";

  // Your message.

 const text = "Hey john";

  // Getting chatId from the number.

  // we have to delete "+" from the beginning and add "@c.us" at the end of the number.

 const chatId = number.substring(1) + "@c.us";

 // Sending message.

 client.sendMessage(chatId, text);

});

0 Answers0