rohitsangwan01 / whatsapp_bot_flutter

Whatsapp bot for flutter desktop
MIT License
37 stars 24 forks source link

Group chat functionalities #22

Closed loic-hamdi closed 1 year ago

loic-hamdi commented 1 year ago

Hi, Is there a way to post in a chat group? Also, adding/removing users?

rohitsangwan01 commented 1 year ago

@loic-hamdi this project is using a js library, can you check here : https://wppconnect.io/wa-js/ if this feature is available in wa-js , then we can port to this library as well

loic-hamdi commented 1 year ago

To post a message in a group, it actually already works when you use message.to with the groupId (for example const groupId = "12036314568012369@g.us")

For group participants, it seems to exist in wa-js :

Add participants to group

Remove participants to group

rohitsangwan01 commented 1 year ago

@loic-hamdi ok so we can do this but i can't commit the time yet, if you want you can push a Pr , we need to add a new module : wpp_group to handle groups related methods here

rohitsangwan01 commented 1 year ago

@loic-hamdi there is one more way to try, you can run any method from that Wa-Js library using

whatsappClient.wpClient.evaluateJs("WPP.group.addParticipants('[group@g.us]', [number@c.us])");

you can checkout examples here

and if this works for you, let me know and i will expose that as a proper method in this library, but for now you can try this workaround for unreleased features

rohitsangwan01 commented 1 year ago

Fixed in https://github.com/rohitsangwan01/whatsapp_bot_flutter/pull/28