@wppconnect/wa-js - v3.19.3
    Preparing search index...

    Function setProperty

    • Set the group property

      Parameters

      • groupId: string | Wid
      • property: GroupProperty
      • value: boolean | 0 | 1 | 86400 | 604800 | 7776000

      Returns Promise<boolean>

      // Only admins can send message
      await WPP.group.setProperty('[group-id]@g.us', 'announcement', true);

      // All can send message
      await WPP.group.setProperty('[group-id]@g.us', 'announcement', false);

      // Disatble temporary messages
      await WPP.group.setProperty('[group-id]@g.us', 'ephemeral', 0);

      // Enable temporary messages for 24 hours
      await WPP.group.setProperty('[group-id]@g.us', 'ephemeral', 86400);

      // Enable temporary messages for 7 days
      await WPP.group.setProperty('[group-id]@g.us', 'ephemeral', 604800);

      // Enable temporary messages for 90 days
      await WPP.group.setProperty('[group-id]@g.us', 'ephemeral', 7776000);

      // Only admins can edit group properties
      await WPP.group.setProperty('[group-id]@g.us', 'restrict', true);

      // All can edit group properties
      await WPP.group.setProperty('[group-id]@g.us', 'restrict', false);