@poucode/baileys 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -2
- package/lib/Socket/chats.js +5 -0
- package/lib/Socket/graphql.js +716 -0
- package/lib/Socket/index.js +10 -2
- package/lib/Socket/interop.js +463 -0
- package/lib/Socket/luxu.js +1 -1
- package/lib/Socket/message-builder.js +475 -0
- package/lib/Socket/messages-send.js +29 -4
- package/lib/Socket/privacy.js +318 -0
- package/lib/Store/make-in-memory-store.js +47 -1
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/long-safe.js +33 -0
- package/lib/Utils/messages-media.js +82 -0
- package/lib/Utils/messages.js +137 -3
- package/lib/Utils/sticker.js +133 -0
- package/lib/Utils/use-sqlite-auth-state.js +162 -0
- package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +43 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +53 -50
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +56 -52
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +29 -25
- package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +58 -0
- package/lib/WAUSync/Protocols/USyncPictureProtocol.js +32 -0
- package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +28 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -36
- package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +26 -23
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +52 -49
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -27
- package/lib/WAUSync/Protocols/index.js +12 -5
- package/lib/WAUSync/USyncQuery.js +150 -96
- package/lib/WAUSync/USyncUser.js +55 -29
- package/lib/WAUSync/index.js +3 -3
- package/lib/index.js +1 -0
- package/package.json +12 -7
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ npm install github:pou-code/Baileys
|
|
|
36
36
|
Or add it to your `package.json` manually:
|
|
37
37
|
```json
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@poucode/baileys": "
|
|
39
|
+
"@poucode/baileys": "latest"
|
|
40
40
|
}
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -45,7 +45,7 @@ Already have a bot built on the original `@whiskeysockets/baileys` and don't wan
|
|
|
45
45
|
name points to this fork:
|
|
46
46
|
```json
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@whiskeysockets/baileys": "
|
|
48
|
+
"@whiskeysockets/baileys": "npm:poucode/baileys"
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
With this alias, keep using `require('@whiskeysockets/baileys')` in your code as-is — npm will
|
|
@@ -418,6 +418,25 @@ await client.statusMention(m.chat, {
|
|
|
418
418
|
|
|
419
419
|
---
|
|
420
420
|
|
|
421
|
+
# Merged Features (1.1.0)
|
|
422
|
+
|
|
423
|
+
WaBail 1.1.0 merges the extra layers of the `wbails` fork on top of the PouCode core:
|
|
424
|
+
|
|
425
|
+
- `sock.*` privacy, interop, GraphQL/Wamo and message-builder layers (see `lib/Socket/privacy.js`, `interop.js`, `graphql.js`, `message-builder.js`)
|
|
426
|
+
- Extra USync protocols: business, picture, text status, sidelist, feature (`lib/WAUSync/`)
|
|
427
|
+
- Sticker pack messages (`{ stickerPacks: {...} }`) and sticker metadata helpers (`lib/Utils/sticker.js`, needs `ffmpeg` in `PATH` for sticker conversion)
|
|
428
|
+
- `useSqliteAuthState` (needs Node 22.5+ because it uses `node:sqlite`; loaded lazily, so Node 20 is unaffected unless you call it)
|
|
429
|
+
- `makeInMemoryStore` persistence helpers: `writeToFile`, `readFromFile`, `writeToFileInterval`
|
|
430
|
+
- 1:1 `cstoken` fallback: stores the NCT salt from app-state sync and attaches `cstoken` on private sends that have no `tctoken`. Disable per message with `{ cstoken: false }`.
|
|
431
|
+
|
|
432
|
+
The newsletter implementation is the one from WaBail (`lib/Socket/newsletter.js`) and is used unchanged.
|
|
433
|
+
|
|
434
|
+
## Private chat vs group notes
|
|
435
|
+
|
|
436
|
+
- Reply to `msg.key.remoteJid` as-is. In private chats it can be `@lid`; the phone-number form is in `msg.key.remoteJidAlt`.
|
|
437
|
+
- In groups the sender is `msg.key.participant` (alt in `msg.key.participantAlt`).
|
|
438
|
+
- If a send to a user cannot resolve any of the recipient's devices, `relayMessage` now throws `421` instead of silently reporting success.
|
|
439
|
+
|
|
421
440
|
# Credits
|
|
422
441
|
|
|
423
442
|
PouCode is a fork of [Baileys](https://github.com/WhiskeySockets/Baileys), originally created by
|
package/lib/Socket/chats.js
CHANGED
|
@@ -397,6 +397,11 @@ export const makeChatsSocket = (config) => {
|
|
|
397
397
|
return {
|
|
398
398
|
onMutation(mutation) {
|
|
399
399
|
processSyncAction(mutation, ev, authState.creds.me, isInitialSync ? { accountSettings: authState.creds.accountSettings } : undefined, logger);
|
|
400
|
+
const nctSalt = mutation?.syncAction?.value?.nctSaltSyncAction?.salt;
|
|
401
|
+
if (nctSalt?.length) {
|
|
402
|
+
authState.keys.set({ 'nct-salt': { default: Buffer.from(nctSalt) } })
|
|
403
|
+
.catch(err => logger?.debug({ err: err?.message }, 'failed to store nct salt'));
|
|
404
|
+
}
|
|
400
405
|
}
|
|
401
406
|
};
|
|
402
407
|
};
|