open-wa / wa-automate-nodejs

šŸ’¬ šŸ¤– The most reliable tool for chatbots with advanced features. Be sure to šŸŒŸ this repository for updates!
https://docs.openwa.dev/
Other
3.13k stars 597 forks source link

After clearing the chat, a new group is detected and members enter #2280

Closed badriyatus123 closed 2 years ago

badriyatus123 commented 2 years ago

Are you using the latest version of the library?

Current Behavior

I deleted all messages using

const allChats = await client.getAllChats()
for (let delChats of allChats) {
  await client.deleteChat(delChats.id)
}

after that I tried restarting my server while waiting for the chat cleanup to be successful, and when the chat cleanup was finished I reactivated it and there all the deleted groups detected onAddedToGroupand members message.groupMetadata.participants .length only partially detected even 0

Expected Behavior

I hope it is fixed because it also affects the welcome feature where all members in the group that were affected by deletion are detected as new members entering the group and it becomes welcome spam to the group

Steps To Reproduce

1.Delete all messages 2.Run the bot which has "onAddedToGroup"

  1. After that there will be group members who chat for sure "onAddedToGroup" will detect a new group

Mode

My own code

create() code

create({
    useChrome: true,
    qrLogSkip: false,
})

DEBUG INFO

WA_VERSION : '2.2142.12'
PAGE_UA : 'WhatsApp/2.2108.8 Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36'
WA_AUTOMATE_VERSION : '4.23.7'
BROWSER_VERSION : 'HeadlessChrome/93.0.4577.0'
OS :'Windows 10'
START_TS : 1636426111957

Environment

- OS: windows 1-
- Node: v16.13.0
- npm: 8.1.0

Screenshots

image

Anything else?

No response

smashah commented 2 years ago

looks like this issue fell through the cracks. Let me know if it this is still a problem. Closing for now