Skip to content

When calling group.setDescription(newDescription) on a Chat object, the method throws an error: "Cannot read properties of undefined (reading 'get')". #201708

@likeahurricane

Description

@likeahurricane

Issue Description

Description

When calling group.setDescription(newDescription) on a Chat object, the method throws an error: "Cannot read properties of undefined (reading 'get')".

Expected Behavior

The group description should be updated successfully.

Actual Behavior

Throws error: "Cannot read properties of undefined (reading 'get')"

Additional Context

  • The user is admin of the group
  • This happens consistently across multiple groups
  • The error occurs at the method call level, not during execution
  • Tested with latest version (1.34.6) - issue persists

Logs

[ERROR]: Error processing group GroupName: Cannot read properties of undefined (reading 'get')

Reproduction Steps

  1. Get a Chat object from client.getChats()
  2. Call chat.setDescription("new description")
  3. Error occurs immediately

Code Sample

async function executeReplaceGroupLinksCommand(client, msg) {
  try {
    const chats = await client.getChats();
    const group = chats.find(chat => chat.isGroup);

if (group && typeof group.setDescription === 'function') {
      try {
        const result = await group.setDescription("new description");
        console.log("Success");
      } catch (error) {
        console.error("Error:", error.message); // "Cannot read properties of undefined (reading 'get')"
      }
    }
  } catch (error) {
    console.error("Error:", error.message);
  }
}

User Setup

WhatsApp Type
Account Type Standard
Authentication Strategy LocalAuth
WhatsApp Web Version 2.3000.1036990300
whatsapp-web.js Version 1.34.6
Environment Version
Browser Type Chrome
Browser Version 146.0.7680.153
Phone OS Version Android 16
Running OS Version Ubuntu 23.04 (Lunar Lobster)
Node.js Version 22.17.0

Checklist

  • I use the latest released version of whatsapp-web.js.
  • I have searched existing issues and confirmed this is not a duplicate.
  • I have verified this is a library issue, not a problem with my code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokenissued mediumMedium impact issuetypingsType definitions

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions