Open unilogica opened 11 months ago
I would suggest community support. I've seen WPPConnect implement this and would like to take the opportunity and ask if anyone knows how I can port this to the Baileys. Exists some doc to explain how can I inspect WhatsApp to create this feature?
https://github.com/wppconnect-team/wppconnect/blob/master/src/api/layers/community.layer.ts
I can probably port it from my library cobalt tomorrow. I'll open a PR once I'm done
Wow! I started reading the documentation of your Cobalt repo, what a fantastic job 👏
Uhm I'm having some problems with the community create node. It looks right, but it's throwing: Received node Node[description=iq, attributes={from=g.us, id=d329cc8a1b, type=error}, content=[Node[description=error, attributes={code=400, text=bad-request}]]] I'll try to fix it asap so I can open the PR
I saw some of your repos and noticed the WhatsappWebRequestAnalyzer. Java and Kotlin aren't even close to my most familiar stacks, but from what I understand this project uses Chrome 90 injected with a layer that takes every request made by WhatsApp.
Is that how you were able to reverse engineer this community feature originally for Cobalt?
I saw some of your repos and noticed the WhatsappWebRequestAnalyzer. Java and Kotlin aren't even close to my most familiar stacks, but from what I understand this project uses Chrome 90 injected with a layer that takes every request made by WhatsApp.
Is that how you were able to reverse engineer this community feature originally for Cobalt?
Yeah, actually I use chrome 114, but you should be able to use any Chrome ≥ 111 To give you a gist, the analyzer:
You also need to understand the original Whatsapp web source code most of the times, but having the raw node is definitely a good start.
To see the mobile's app nodes download the Whatsapp beta and run the following adb command: adb shell logcat | grep WhatsApp: You might need an APK from may 2023 because afaict new versions don't print them out.
I used this code to make the IQ request. Bug getting 400. Any Idea?
communityCreate: async (subject: string) => {
const result = await groupQuery("@g.us", "set", [
{
tag: "create",
attrs: {
subject,
},
content: [
{
tag: "description",
attrs: {
id: generateMessageTag(),
},
content: [
{
tag: "body",
attrs: {},
content: Buffer.from("The community description", "utf-8"),
},
],
},
{
tag: "parent",
attrs: {
default_membership_approval_mode: "request_required",
},
},
],
},
]);
console.log(result);
// return extractGroupMetadata(result)
};
Inside the "example.ts", make an request to WA servers using:
const createCommunitResponse = await sock.communityCreate('Community name')
console.log('DEBUG:', createCommunitResponse)
The expected result is something like this:
<notification from="XXXXXXXXXXXXXXXXXX@g.us" type="w:gp2" id="PPPPPPPPP"
participant="KKKKKKKKKK@s.whatsapp.net" addressing_mode="pn" notify="Guilherme ي"
t="TTTTTTTT">
<create type="new">
<group subject="Community name" creator="KKKKKKKKKK@s.whatsapp.net" s_o="KKKKKKKKKK@s.whatsapp.net"
id="XXXXXXXXXXXXXXXXXX" creation="YYYYYYYY" s_t="YYYYYYYY" size="1"
p_v_id="JJJJJJJJJJJJJJJ" a_v_id="JJJJJJJJJJJJJJJ">
<participant jid="KKKKKKKKKK@s.whatsapp.net" type="superadmin" />
<description participant="KKKKKKKKKK@s.whatsapp.net" id="AAAA.AAAAA-AAA"
t="YYYYYYYY">
<body>"The community description"</body>
</description>
<parent default_membership_approval_mode="request_required" />
<member_add_mode>"admin_add"</member_add_mode>
</group>
</create>
</notification>
any news on this subject? it would be great to be able to count communities so you can message them mainly in the general notices group.
Up
If someone still needs it I could port it from my library as I found the fix
Any updates on the matter, I would really like to use the community functions, I saw that @Auties00 had found a solution, but has it already been incorporated into Baileys?
Any updates on the matter, I would really like to use the community functions, I saw that @Auties00 had found a solution, but has it already been incorporated into Baileys?
I should add support for both communities and channels in the near future. I'd like to do it this week, but I have to study as my mid terms are coming up for uni. I'll do it asap tho
Any updates on the matter, I would really like to use the community functions, I saw that @Auties00 had found a solution, but has it already been incorporated into Baileys?
I should add support for both communities and channels in the near future. I'd like to do it this week, but I have to study as my mid terms are coming up for uni. I'll do it asap tho
Thank you for the response and the attention, I will be waiting and good luck with your studies.
Any updates on the matter, I would really like to use the community functions, I saw that @Auties00 had found a solution, but has it already been incorporated into Baileys?
I should add support for both communities and channels in the near future. I'd like to do it this week, but I have to study as my mid terms are coming up for uni. I'll do it asap tho
Thank you for the response and the attention, I will be waiting and good luck with your studies.
Thanks :)
I'm looking forward to receive this new feature in baileys!!!
Are there some news?
Are there some news to receive this new feature in baileys?
any update?
I would suggest community support. I've seen WPPConnect implement this and would like to take the opportunity and ask if anyone knows how I can port this to the Baileys. Exists some doc to explain how can I inspect WhatsApp to create this feature?
https://github.com/wppconnect-team/wppconnect/blob/master/src/api/layers/community.layer.ts