WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.64k stars 1.23k forks source link

[BUG] socket.groupParticipantsUpdate fails silently #375

Closed olalonde closed 1 year ago

olalonde commented 1 year ago

Describe the bug When you try to add a participant to a group that the participant has left recently, it's not possible to add back the participant.

Screenshot 2023-09-09 at 2 19 07 PM

When this happens, the call to socket.groupParticipantsUpdate appears to succeed when it does not. It would be better if an error was thrown.

To Reproduce Steps to reproduce the behavior:

  1. Created a group and add Alice
  2. Alice leaves group
  3. Try adding Alice back to group

Expected behavior An error should be thrown.

aliazhar-id commented 1 year ago

image

mine works;

P.S: "Oops!, @ Ali Azhar | Me has left this group recently !" the translate

olalonde commented 1 year ago

@aliazhar-id You used an "invite link" which is not affected by this limitation. See https://faq.whatsapp.com/420332980275753

olalonde commented 1 year ago

Ah, did you mean that your call to socket.groupParticipantsUpdate is throwing an error?

olalonde commented 1 year ago

Ah I see, it returns a result object instead of throwing. https://github.com/WhiskeySockets/Baileys/blob/cd8542ff7c072b5e58d2d3de2396983a5304e5e1/src/Socket/groups.ts#L195

aliazhar-id commented 1 year ago

@aliazhar-id You used an "invite link" which is not affected by this limitation. See https://faq.whatsapp.com/420332980275753

Ahh, I shouldn't have capture that last one.

when using a bot it cannot be added and returns an error. "left recently" the last one I joined manually using the invite link

aliazhar-id commented 1 year ago

Ah, did you mean that your call to socket.groupParticipantsUpdate is throwing an error?

yes