We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isGroup is undefined & group chat being identified as PrivateChat.
Workaround:
const { Client, LocalAuth } = require("whatsapp-web.js"); const client = new Client({ puppeteer: { headless: true, args: ["--no-sandbox", "--disable-setuid-sandbox"], }, authStrategy: new LocalAuth(), webVersionCache: { type: "remote", remotePath: "https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.3000.1018501131-alpha.html", }, }); client.on("message", async (msg) => { const { from } = msg; const chat = await msg.getChat(); let contact = await chat.getContact(); if (contact.isGroup === true) { console.log("Ignoring group message"); return; } else { console.log("Message received:", msg.body); } }); ### Expected Behavior I expected chat.isGroup to be true or false, instead, I got undefined.
Chat: PrivateChat { id: { server: 'g.us', user: 'aaa', _serialized: '[email protected]' }, name: '', isGroup: undefined, isReadOnly: false, unreadCount: 0, timestamp: 1732716353, archived: undefined, pinned: false, isMuted: undefined, muteExpiration: 0, lastMessage: Message { _data: { id: [Object], viewed: false, body: 'hi', type: 'chat', t: 1732716421, notifyName: 'aaa', from: [Object], to: [Object], author: [Object], ack: 1, invis: false, isNewMsg: true, star: false, kicNotified: false, recvFresh: true, isFromTemplate: false, pollInvalidated: false, isSentCagPollCreation: false, latestEditMsgKey: null, latestEditSenderTimestampMs: null, mentionedJidList: [], groupMentions: [], isEventCanceled: false, eventInvalidated: false, isVcardOverMmsDocument: false, isForwarded: false, hasReaction: false, viewMode: 'VISIBLE', messageSecret: [Object], productHeaderImageRejected: false, lastPlaybackProgress: 0, isDynamicReplyButtonsMsg: false, isCarouselCard: false, parentMsgId: null, isMdHistoryMsg: false, stickerSentTs: 0, isAvatar: false, lastUpdateFromServerTs: 0, invokedBotWid: null, bizBotType: null, botResponseTargetId: null, botPluginType: null, botPluginReferenceIndex: null, botPluginSearchProvider: null, botPluginSearchUrl: null, botPluginSearchQuery: null, botPluginMaybeParent: false, botReelPluginThumbnailCdnUrl: null, botMsgBodyType: null, requiresDirectConnection: false, bizContentPlaceholderType: null, hostedBizEncStateMismatch: false, senderOrRecipientAccountTypeHosted: false, placeholderCreatedWhenAccountIsHosted: false, links: [] }, mediaKey: undefined, id: { fromMe: false, remote: '[email protected]', id: '3A179859486398FC30D6', participant: [Object], _serialized: 'false_120363371704224503@[email protected]' }, ack: 1, hasMedia: false, body: 'hi', type: 'chat', timestamp: 1732716421, from: '[email protected]', to: '[email protected]', author: '[email protected]', deviceType: 'ios', isForwarded: false, forwardingScore: 0, isStatus: false, isStarred: false, broadcast: undefined, fromMe: false, hasQuotedMsg: false, hasReaction: false, duration: undefined, location: undefined, vCards: [], inviteV4: undefined, mentionedIds: [], groupMentions: [], orderId: undefined, token: undefined, isGif: false, isEphemeral: undefined, links: [] } } Message received: hi
### Steps to Reproduce the Bug or Issue ```js const { Client, LocalAuth } = require("whatsapp-web.js"); const client = new Client({ puppeteer: { headless: true, args: ["--no-sandbox", "--disable-setuid-sandbox"], }, authStrategy: new LocalAuth(), webVersionCache: { type: "remote", remotePath: "https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.3000.1018501131-alpha.html", }, }); client.on("message", async (msg) => { const { from } = msg; const chat = await msg.getChat(); console.log("Chat:", chat); if (chat.isGroup === true) { console.log("Ignoring group message"); return; } else { console.log("Message received:", msg.body); } });
Standard
Google Chrome (Mac OS)
Mac OS
Android
1.26.0
2.3000.1018501131
v21.5.0
LocalAuth
No response
The text was updated successfully, but these errors were encountered:
same here setsubject etc. therefore stopped working. god....
Sorry, something went wrong.
Fixed in #3380
Use
npm install [email protected]
No branches or pull requests
Is there an existing issue for this?
Is this a problem caused by your code, or is it specifically because of the library?
Describe the bug.
isGroup is undefined & group chat being identified as PrivateChat.
Workaround:
Chat: PrivateChat {
id: {
server: 'g.us',
user: 'aaa',
_serialized: '[email protected]'
},
name: '',
isGroup: undefined,
isReadOnly: false,
unreadCount: 0,
timestamp: 1732716353,
archived: undefined,
pinned: false,
isMuted: undefined,
muteExpiration: 0,
lastMessage: Message {
_data: {
id: [Object],
viewed: false,
body: 'hi',
type: 'chat',
t: 1732716421,
notifyName: 'aaa',
from: [Object],
to: [Object],
author: [Object],
ack: 1,
invis: false,
isNewMsg: true,
star: false,
kicNotified: false,
recvFresh: true,
isFromTemplate: false,
pollInvalidated: false,
isSentCagPollCreation: false,
latestEditMsgKey: null,
latestEditSenderTimestampMs: null,
mentionedJidList: [],
groupMentions: [],
isEventCanceled: false,
eventInvalidated: false,
isVcardOverMmsDocument: false,
isForwarded: false,
hasReaction: false,
viewMode: 'VISIBLE',
messageSecret: [Object],
productHeaderImageRejected: false,
lastPlaybackProgress: 0,
isDynamicReplyButtonsMsg: false,
isCarouselCard: false,
parentMsgId: null,
isMdHistoryMsg: false,
stickerSentTs: 0,
isAvatar: false,
lastUpdateFromServerTs: 0,
invokedBotWid: null,
bizBotType: null,
botResponseTargetId: null,
botPluginType: null,
botPluginReferenceIndex: null,
botPluginSearchProvider: null,
botPluginSearchUrl: null,
botPluginSearchQuery: null,
botPluginMaybeParent: false,
botReelPluginThumbnailCdnUrl: null,
botMsgBodyType: null,
requiresDirectConnection: false,
bizContentPlaceholderType: null,
hostedBizEncStateMismatch: false,
senderOrRecipientAccountTypeHosted: false,
placeholderCreatedWhenAccountIsHosted: false,
links: []
},
mediaKey: undefined,
id: {
fromMe: false,
remote: '[email protected]',
id: '3A179859486398FC30D6',
participant: [Object],
_serialized: 'false_120363371704224503@[email protected]'
},
ack: 1,
hasMedia: false,
body: 'hi',
type: 'chat',
timestamp: 1732716421,
from: '[email protected]',
to: '[email protected]',
author: '[email protected]',
deviceType: 'ios',
isForwarded: false,
forwardingScore: 0,
isStatus: false,
isStarred: false,
broadcast: undefined,
fromMe: false,
hasQuotedMsg: false,
hasReaction: false,
duration: undefined,
location: undefined,
vCards: [],
inviteV4: undefined,
mentionedIds: [],
groupMentions: [],
orderId: undefined,
token: undefined,
isGif: false,
isEphemeral: undefined,
links: []
}
}
Message received: hi
WhatsApp Account Type
Standard
Browser Type
Google Chrome (Mac OS)
Operation System Type
Mac OS
Phone OS Type
Android
WhatsApp-Web.js Version
1.26.0
WhatsApp Web Version
2.3000.1018501131
Node.js Version
v21.5.0
Authentication Strategy
LocalAuth
Additional Context
No response
The text was updated successfully, but these errors were encountered: