Closed devsakae closed 8 months ago
This is Group X (personal info was REMOVED_BY_DEVSAKAE)
GroupChat {
groupMetadata: {
id: [Object],
creation: 1401890927,
owner: [Object],
subject: 'REMOVED_BY_DEVSAKAE',
subjectTime: 1700836188,
desc: 'REMOVED_BY_DEVSAKAE',
descId: '1691477925-477',
descTime: 0,
restrict: false,
announce: false,
noFrequentlyForwarded: false,
ephemeralDuration: 0,
membershipApprovalMode: false,
reportToAdminMode: false,
size: 9,
support: false,
suspended: false,
terminated: false,
uniqueShortNameMap: {},
isLidAddressingMode: false,
isParentGroup: false,
isParentGroupClosed: false,
defaultSubgroup: false,
generalSubgroup: false,
generalChatAutoAddDisabled: false,
allowNonAdminSubGroupCreation: false,
lastActivityTimestamp: 0,
lastSeenActivityTimestamp: 0,
incognito: false,
participants: [Array],
pendingParticipants: [],
pastParticipants: [],
membershipApprovalRequests: [],
subgroupSuggestions: []
},
id: {
server: 'g.us',
user: 'REMOVED_BY_DEVSAKAE',
_serialized: 'REMOVED_BY_DEVSAKAE@g.us'
},
name: 'REMOVED_BY_DEVSAKAE',
isGroup: true,
isReadOnly: false,
unreadCount: 0,
timestamp: 1701256209,
archived: undefined,
pinned: false,
isMuted: false,
muteExpiration: 0,
lastMessage: Message {
_data: [Object],
mediaKey: undefined,
id: [Object],
ack: undefined,
hasMedia: false,
body: '',
type: 'e2e_notification',
timestamp: 1701262798,
from: 'REMOVED_BY_DEVSAKAE@g.us',
to: 'REMOVED_BY_DEVSAKAE@c.us',
author: undefined,
deviceType: 'android',
isForwarded: false,
forwardingScore: 0,
isStatus: false,
isStarred: false,
broadcast: undefined,
fromMe: false,
hasQuotedMsg: false,
hasReaction: false,
duration: undefined,
location: undefined,
vCards: [],
inviteV4: undefined,
mentionedIds: [],
orderId: undefined,
token: undefined,
isGif: false,
isEphemeral: undefined,
links: []
}
}
Client.getChats
returns chat that are stored in Chat Store
, also groups that you were removed from or left
You can use Chat.delete
to remove the chat/group from the Store
Thanks for this.
Wouldn't be nice to execute this delete by default when you are remove from a group chat?
Is there an existing issue for this?
Describe the bug
My bot was joining groups freely (until I configured to only do it if join request was made by my personal number).
So, it happened to be invited, automatically joined, stayed for a couple minutes, and was removed by an admin of "group X", when I saw it. Then I manually erased the group on the WhatsApp (Business) App.
Now, when my bot starts, as it fetches all chats with .getChats(), it still shows that group on the list, despite it's not active, not joined, not even on the chat list of my WPB app.
I even removed .wwebjs_cache, thinking that would be a cache problem, but the problem persists.
Expected behavior
Expect to not show old or not joined groups, but .getChats() are showing a specifically one
Steps to Reproduce the Bug or Issue
Relevant Code
Browser Type
Google Chrome
WhatsApp Account Type
WhatsApp Business
Does your WhatsApp account have multidevice enabled?
No, I am not using Multi Device
Environment
OS: Ubuntu 22.04 Phone OS: Android and iOS wweb.js: github:alechkos/whatsapp-web.js#channels Node: 20.9.0
Additional context
No response