mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
WEB WAM IMPLEMENTATION!!!!! (#708)
* feat(WAM): initial commit * fix(wam-development): I made a whoopsie * Update Example/example.ts Co-authored-by: Javier Cuevas <javiercr@gmail.com> --------- Co-authored-by: Javier Cuevas <javiercr@gmail.com>
This commit is contained in:
@@ -547,6 +547,24 @@ export const makeSocket = (config: SocketConfig) => {
|
||||
return Buffer.concat([salt, randomIv, ciphered])
|
||||
}
|
||||
|
||||
const sendWAMBuffer = (wamBuffer: Buffer) => {
|
||||
return query({
|
||||
tag: 'iq',
|
||||
attrs: {
|
||||
to: S_WHATSAPP_NET,
|
||||
id: generateMessageTag(),
|
||||
xmlns: 'w:stats'
|
||||
},
|
||||
content: [
|
||||
{
|
||||
tag: 'add',
|
||||
attrs: {},
|
||||
content: wamBuffer
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
ws.on('message', onMessageRecieved)
|
||||
ws.on('open', async() => {
|
||||
try {
|
||||
@@ -723,6 +741,7 @@ export const makeSocket = (config: SocketConfig) => {
|
||||
requestPairingCode,
|
||||
/** Waits for the connection to WA to reach a state */
|
||||
waitForConnectionUpdate: bindWaitForConnectionUpdate(ev),
|
||||
sendWAMBuffer,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user