#set description for new group I've created

4 messages · Page 1 of 1 (latest)

trim delta
#

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!

viscid lintel
#

const group = await client.getChatById('group_id');
group.setDescription('This is a group for discussing movies'); ... can you test this ?

gloomy plaza
#

I tested and it didn't work

craggy iron
#

group description has been fixed in the alpha version, could you install and test it?