Hey!
I'm trying to open new groups and edit for each group the group description
this is my code:
const data = fs.readFileSync('groups.txt', 'utf8');
const lines = data.split('\n');
for (let line of lines) {
line = line.trim();
if (line === '') continue;
const participants = line.split(',').map(number => number.trim());
const groupName = 'my group;
const contactIds = participants
.filter(number => number.length === 10) // Filter out invalid phone numbers
.map(number => `681${number.slice(1)}@c.us`);
console.log(`Creating group "${groupName}" with participants: ${contactIds.join(', ')}`);
const group = await client.createGroup(groupName, contactIds);
console.log(`Group "${groupName}" created successfully.`);
const message = 'Your message goes here';
const groupId = group.gid['_serialized'];
const msg = await client.sendMessage(groupId, message);
const chatById = client.getChatById(groupId);
const desc = chatById.setDescription(message); // this line is not working
can someone please help me?
thanks!