@fazzcode/baileys 0.1.6 → 2.0.6
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/LICENSE +21 -0
- package/WAProto/WAProto.proto +5311 -0
- package/WAProto/index.js +83385 -119575
- package/lib/Defaults/index.js +117 -124
- package/lib/KeyDB/BinarySearch.js +20 -0
- package/lib/KeyDB/KeyedDB.js +167 -0
- package/lib/KeyDB/index.js +4 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -14
- package/lib/Signal/Group/group-session-builder.js +10 -42
- package/lib/Signal/Group/group_cipher.js +75 -87
- package/lib/Signal/Group/index.js +13 -57
- package/lib/Signal/Group/keyhelper.js +17 -52
- package/lib/Signal/Group/sender-chain-key.js +27 -33
- package/lib/Signal/Group/sender-key-distribution-message.js +62 -63
- package/lib/Signal/Group/sender-key-message.js +65 -66
- package/lib/Signal/Group/sender-key-name.js +45 -44
- package/lib/Signal/Group/sender-key-record.js +39 -49
- package/lib/Signal/Group/sender-key-state.js +80 -93
- package/lib/Signal/Group/sender-message-key.js +27 -28
- package/lib/Signal/libsignal.js +313 -163
- package/lib/Signal/lid-mapping.js +155 -0
- package/lib/Socket/Client/index.js +4 -19
- package/lib/Socket/Client/types.js +13 -0
- package/lib/Socket/Client/websocket.js +52 -0
- package/lib/Socket/business.js +359 -242
- package/lib/Socket/chats.js +851 -830
- package/lib/Socket/communities.js +413 -0
- package/lib/Socket/groups.js +304 -309
- package/lib/Socket/index.js +15 -9
- package/lib/Socket/messages-recv.js +1107 -1054
- package/lib/Socket/messages-send.js +709 -414
- package/lib/Socket/mex.js +45 -0
- package/lib/Socket/newsletter.js +232 -318
- package/lib/Socket/socket.js +789 -599
- package/lib/Store/index.js +6 -10
- package/lib/Store/make-cache-manager-store.js +73 -81
- package/lib/Store/make-in-memory-store.js +286 -423
- package/lib/Store/make-ordered-dictionary.js +77 -79
- package/lib/Store/object-repository.js +24 -26
- package/lib/Types/Auth.js +3 -2
- package/lib/Types/Bussines.js +3 -0
- package/lib/Types/Call.js +3 -2
- package/lib/Types/Chat.js +9 -4
- package/lib/Types/Contact.js +3 -2
- package/lib/Types/Events.js +3 -2
- package/lib/Types/GroupMetadata.js +3 -2
- package/lib/Types/Label.js +24 -26
- package/lib/Types/LabelAssociation.js +6 -8
- package/lib/Types/Message.js +12 -9
- package/lib/Types/Newsletter.js +31 -30
- package/lib/Types/Newsletter.js.bak +33 -0
- package/lib/Types/Product.js +3 -2
- package/lib/Types/Signal.js +3 -2
- package/lib/Types/Socket.js +4 -2
- package/lib/Types/State.js +11 -2
- package/lib/Types/USync.js +3 -2
- package/lib/Types/index.js +27 -41
- package/lib/Utils/auth-utils.js +211 -198
- package/lib/Utils/baileys-event-stream.js +42 -61
- package/lib/Utils/browser-utils.js +25 -0
- package/lib/Utils/business.js +213 -214
- package/lib/Utils/chat-utils.js +710 -687
- package/lib/Utils/crypto.js +112 -133
- package/lib/Utils/decode-wa-message.js +252 -183
- package/lib/Utils/event-buffer.js +510 -496
- package/lib/Utils/generics.js +328 -356
- package/lib/Utils/history.js +83 -92
- package/lib/Utils/index.js +21 -33
- package/lib/Utils/link-preview.js +71 -83
- package/lib/Utils/logger.js +5 -7
- package/lib/Utils/lt-hash.js +40 -46
- package/lib/Utils/make-mutex.js +34 -41
- package/lib/Utils/message-retry-manager.js +113 -0
- package/lib/Utils/messages-media.js +548 -678
- package/lib/Utils/messages.js +352 -249
- package/lib/Utils/noise-handler.js +138 -149
- package/lib/Utils/pre-key-manager.js +85 -0
- package/lib/Utils/process-message.js +323 -303
- package/lib/Utils/signal.js +148 -138
- package/lib/Utils/use-multi-file-auth-state.js +98 -67
- package/lib/Utils/validate-connection.js +183 -188
- package/lib/WABinary/constants.js +1298 -35
- package/lib/WABinary/decode.js +237 -249
- package/lib/WABinary/encode.js +208 -218
- package/lib/WABinary/generic-utils.js +53 -57
- package/lib/WABinary/index.js +7 -21
- package/lib/WABinary/jid-utils.js +89 -58
- package/lib/WABinary/types.js +3 -2
- package/lib/WAM/BinaryInfo.js +10 -12
- package/lib/WAM/constants.js +22851 -15348
- package/lib/WAM/encode.js +135 -136
- package/lib/WAM/index.js +5 -19
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +28 -30
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +49 -53
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -28
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +36 -39
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +50 -50
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +26 -20
- package/lib/WAUSync/Protocols/index.js +6 -20
- package/lib/WAUSync/USyncQuery.js +86 -85
- package/lib/WAUSync/USyncUser.js +23 -25
- package/lib/WAUSync/index.js +5 -19
- package/lib/index.js +32 -34
- package/package.json +99 -105
- package/README.MD +0 -121
- package/engine-requirements.js +0 -10
- package/lib/Defaults/baileys-version.json +0 -3
- package/lib/Defaults/index.d.ts +0 -53
- package/lib/Defaults/phonenumber-mcc.json +0 -223
- package/lib/Signal/Group/ciphertext-message.d.ts +0 -9
- package/lib/Signal/Group/group-session-builder.d.ts +0 -14
- package/lib/Signal/Group/group_cipher.d.ts +0 -17
- package/lib/Signal/Group/index.d.ts +0 -11
- package/lib/Signal/Group/keyhelper.d.ts +0 -10
- package/lib/Signal/Group/queue-job.d.ts +0 -1
- package/lib/Signal/Group/queue-job.js +0 -57
- package/lib/Signal/Group/sender-chain-key.d.ts +0 -13
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -16
- package/lib/Signal/Group/sender-key-message.d.ts +0 -18
- package/lib/Signal/Group/sender-key-name.d.ts +0 -17
- package/lib/Signal/Group/sender-key-record.d.ts +0 -30
- package/lib/Signal/Group/sender-key-state.d.ts +0 -38
- package/lib/Signal/Group/sender-message-key.d.ts +0 -11
- package/lib/Signal/libsignal.d.ts +0 -3
- package/lib/Socket/Client/abstract-socket-client.d.ts +0 -17
- package/lib/Socket/Client/abstract-socket-client.js +0 -13
- package/lib/Socket/Client/index.d.ts +0 -3
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
- package/lib/Socket/Client/mobile-socket-client.js +0 -65
- package/lib/Socket/Client/web-socket-client.d.ts +0 -12
- package/lib/Socket/Client/web-socket-client.js +0 -62
- package/lib/Socket/business.d.ts +0 -171
- package/lib/Socket/chats.d.ts +0 -80
- package/lib/Socket/dugong.d.ts +0 -219
- package/lib/Socket/dugong.js +0 -441
- package/lib/Socket/groups.d.ts +0 -115
- package/lib/Socket/index.d.ts +0 -173
- package/lib/Socket/messages-recv.d.ts +0 -161
- package/lib/Socket/messages-send.d.ts +0 -149
- package/lib/Socket/newsletter.d.ts +0 -134
- package/lib/Socket/registration.d.ts +0 -267
- package/lib/Socket/registration.js +0 -166
- package/lib/Socket/socket.d.ts +0 -43
- package/lib/Socket/usync.d.ts +0 -36
- package/lib/Socket/usync.js +0 -70
- package/lib/Store/index.d.ts +0 -3
- package/lib/Store/make-cache-manager-store.d.ts +0 -13
- package/lib/Store/make-in-memory-store.d.ts +0 -118
- package/lib/Store/make-ordered-dictionary.d.ts +0 -13
- package/lib/Store/object-repository.d.ts +0 -10
- package/lib/Types/Auth.d.ts +0 -110
- package/lib/Types/Call.d.ts +0 -13
- package/lib/Types/Chat.d.ts +0 -102
- package/lib/Types/Contact.d.ts +0 -19
- package/lib/Types/Events.d.ts +0 -157
- package/lib/Types/GroupMetadata.d.ts +0 -55
- package/lib/Types/Label.d.ts +0 -35
- package/lib/Types/LabelAssociation.d.ts +0 -29
- package/lib/Types/Message.d.ts +0 -273
- package/lib/Types/Newsletter.d.ts +0 -92
- package/lib/Types/Product.d.ts +0 -78
- package/lib/Types/Signal.d.ts +0 -57
- package/lib/Types/Socket.d.ts +0 -111
- package/lib/Types/State.d.ts +0 -27
- package/lib/Types/USync.d.ts +0 -25
- package/lib/Types/index.d.ts +0 -57
- package/lib/Utils/auth-utils.d.ts +0 -18
- package/lib/Utils/baileys-event-stream.d.ts +0 -16
- package/lib/Utils/business.d.ts +0 -22
- package/lib/Utils/chat-utils.d.ts +0 -71
- package/lib/Utils/crypto.d.ts +0 -41
- package/lib/Utils/decode-wa-message.d.ts +0 -19
- package/lib/Utils/event-buffer.d.ts +0 -35
- package/lib/Utils/generics.d.ts +0 -92
- package/lib/Utils/history.d.ts +0 -15
- package/lib/Utils/index.d.ts +0 -17
- package/lib/Utils/link-preview.d.ts +0 -21
- package/lib/Utils/logger.d.ts +0 -4
- package/lib/Utils/lt-hash.d.ts +0 -12
- package/lib/Utils/make-mutex.d.ts +0 -7
- package/lib/Utils/messages-media.d.ts +0 -116
- package/lib/Utils/messages.d.ts +0 -77
- package/lib/Utils/noise-handler.d.ts +0 -21
- package/lib/Utils/process-message.d.ts +0 -41
- package/lib/Utils/signal.d.ts +0 -32
- package/lib/Utils/use-multi-file-auth-state.d.ts +0 -13
- package/lib/Utils/validate-connection.d.ts +0 -11
- package/lib/WABinary/constants.d.ts +0 -27
- package/lib/WABinary/decode.d.ts +0 -7
- package/lib/WABinary/encode.d.ts +0 -3
- package/lib/WABinary/generic-utils.d.ts +0 -16
- package/lib/WABinary/index.d.ts +0 -5
- package/lib/WABinary/jid-utils.d.ts +0 -31
- package/lib/WABinary/types.d.ts +0 -18
- package/lib/WAM/BinaryInfo.d.ts +0 -17
- package/lib/WAM/constants.d.ts +0 -38
- package/lib/WAM/encode.d.ts +0 -3
- package/lib/WAM/index.d.ts +0 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -9
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -22
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -12
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -25
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -8
- package/lib/WAUSync/Protocols/index.d.ts +0 -4
- package/lib/WAUSync/USyncQuery.d.ts +0 -28
- package/lib/WAUSync/USyncUser.d.ts +0 -12
- package/lib/WAUSync/index.d.ts +0 -3
- package/lib/index.d.ts +0 -12
package/package.json
CHANGED
|
@@ -1,109 +1,103 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
"name": "@fazzcode/baileys",
|
|
3
|
+
"version": "2.0.6",
|
|
4
|
+
"description": "Websocket Whatsapp API for Node.js",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"whatsapp",
|
|
7
|
+
"websocket",
|
|
8
|
+
"api",
|
|
9
|
+
"nodejs",
|
|
10
|
+
"baileys",
|
|
11
|
+
"wabot",
|
|
12
|
+
"proto",
|
|
13
|
+
"whatsapp-websocket"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "npm:@fazzcode/baileys",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": ""
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "npm:@fazzcode/baileys"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": "FazzCode",
|
|
25
|
+
"type": "commonjs",
|
|
26
|
+
"main": "./lib/index.js",
|
|
27
|
+
"directories": {
|
|
28
|
+
"lib": "lib"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"lib/*",
|
|
32
|
+
"WAProto/*"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"changelog:update": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
36
|
+
"changelog:preview": "conventional-changelog -p angular -u",
|
|
37
|
+
"changelog:last": "conventional-changelog -p angular -r 2",
|
|
38
|
+
"gen:protobuf": "sh WAProto/GenerateStatics.sh",
|
|
39
|
+
"example": "node --inspect Example/example.js",
|
|
40
|
+
"lint": "eslint src --ext .js",
|
|
41
|
+
"lint:fix": "yarn lint --fix",
|
|
42
|
+
"release": "release-it",
|
|
43
|
+
"test": "jest"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@whiskeysockets/eslint-config": "github:whiskeysockets/eslint-config",
|
|
47
|
+
"@cacheable/node-cache": "*",
|
|
48
|
+
"gradient-string": "2.0.2",
|
|
49
|
+
"libsignal-xeuka": "github:tskiofc/libsignal",
|
|
50
|
+
"moment-timezone": "*",
|
|
51
|
+
"music-metadata": "*",
|
|
52
|
+
"cache-manager": "*",
|
|
53
|
+
"async-mutex": "*",
|
|
54
|
+
"@hapi/boom": "*",
|
|
55
|
+
"pbjs": "^0.0.14",
|
|
56
|
+
"protobufjs": "*",
|
|
57
|
+
"lru-cache": "*",
|
|
58
|
+
"readline": "*",
|
|
59
|
+
"p-queue": "*",
|
|
60
|
+
"lodash": "*",
|
|
61
|
+
"figlet": "*",
|
|
62
|
+
"axios": "*",
|
|
63
|
+
"path": "*",
|
|
64
|
+
"pino": "*",
|
|
65
|
+
"ws": "*",
|
|
66
|
+
"fs": "*",
|
|
67
|
+
"os": "*"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"conventional-changelog-cli": "*",
|
|
71
|
+
"link-preview-js": "*",
|
|
72
|
+
"protobufjs-cli": "*",
|
|
73
|
+
"cache-manager": "*",
|
|
74
|
+
"@types/jest": "*",
|
|
75
|
+
"@types/node": "*",
|
|
76
|
+
"release-it": "*",
|
|
77
|
+
"@types/ws": "*",
|
|
78
|
+
"eslint": "*",
|
|
79
|
+
"jest": "*",
|
|
80
|
+
"json": "*",
|
|
81
|
+
"open": "*"
|
|
82
|
+
},
|
|
83
|
+
"peerDependencies": {
|
|
84
|
+
"link-preview-js": "*",
|
|
85
|
+
"audio-decode": "*",
|
|
86
|
+
"jimp": ">=0.16.0"
|
|
87
|
+
},
|
|
88
|
+
"peerDependenciesMeta": {
|
|
89
|
+
"audio-decode": {
|
|
90
|
+
"optional": true
|
|
18
91
|
},
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"main": "lib/index.js",
|
|
22
|
-
"types": "lib/index.d.ts",
|
|
23
|
-
"files": [
|
|
24
|
-
"lib/*",
|
|
25
|
-
"WAProto/*.js",
|
|
26
|
-
"engine-requirements.js"
|
|
27
|
-
],
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build:all": "tsc && typedoc",
|
|
30
|
-
"build:docs": "typedoc",
|
|
31
|
-
"build:tsc": "tsc",
|
|
32
|
-
"changelog:last": "conventional-changelog -p angular -r 2",
|
|
33
|
-
"changelog:preview": "conventional-changelog -p angular -u",
|
|
34
|
-
"changelog:update": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
35
|
-
"example": "node --inspect -r ts-node/register Example/example.ts",
|
|
36
|
-
"gen:protobuf": "sh WAProto/GenerateStatics.sh",
|
|
37
|
-
"lint": "eslint src --ext .js,.ts,.jsx,.tsx",
|
|
38
|
-
"lint:fix": "eslint src --fix --ext .js,.ts,.jsx,.tsx",
|
|
39
|
-
"prepack": "",
|
|
40
|
-
"prepare": "",
|
|
41
|
-
"preinstall": "node ./engine-requirements.js",
|
|
42
|
-
"release": "release-it",
|
|
43
|
-
"test": "jest"
|
|
92
|
+
"jimp": {
|
|
93
|
+
"optional": true
|
|
44
94
|
},
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
"@hapi/boom": "^9.1.3",
|
|
48
|
-
"@cacheable/node-cache": "^1.4.0",
|
|
49
|
-
"audio-decode": "^2.1.3",
|
|
50
|
-
"axios": "^1.3.3",
|
|
51
|
-
"cache-manager": "4.0.1",
|
|
52
|
-
"chalk": "^4.1.2",
|
|
53
|
-
"futoin-hkdf": "^1.5.1",
|
|
54
|
-
"libphonenumber-js": "^1.10.20",
|
|
55
|
-
"libsignal": "npm:@shennmine/libsignal-node",
|
|
56
|
-
"music-metadata": "^7.12.3",
|
|
57
|
-
"node-cache": "^5.1.2",
|
|
58
|
-
"pino": "^7.0.0",
|
|
59
|
-
"protobufjs": "^7.2.4",
|
|
60
|
-
"uuid": "^9.0.0",
|
|
61
|
-
"ws": "^8.13.0"
|
|
62
|
-
},
|
|
63
|
-
"devDependencies": {
|
|
64
|
-
"@adiwajshing/eslint-config": "github:adiwajshing/eslint-config",
|
|
65
|
-
"@types/got": "^9.6.11",
|
|
66
|
-
"@types/jest": "^27.5.1",
|
|
67
|
-
"@types/node": "^16.0.0",
|
|
68
|
-
"@types/sharp": "^0.29.4",
|
|
69
|
-
"@types/ws": "^8.0.0",
|
|
70
|
-
"conventional-changelog-cli": "^2.2.2",
|
|
71
|
-
"eslint": "^8.0.0",
|
|
72
|
-
"jest": "^27.0.6",
|
|
73
|
-
"jimp": "^0.16.1",
|
|
74
|
-
"link-preview-js": "^3.0.0",
|
|
75
|
-
"open": "^8.4.2",
|
|
76
|
-
"qrcode-terminal": "^0.12.0",
|
|
77
|
-
"release-it": "^15.10.3",
|
|
78
|
-
"sharp": "^0.30.5",
|
|
79
|
-
"ts-jest": "^27.0.3",
|
|
80
|
-
"ts-node": "^10.8.1",
|
|
81
|
-
"typedoc": "^0.24.7",
|
|
82
|
-
"typescript": "^4.6.4",
|
|
83
|
-
"json": "^11.0.0"
|
|
84
|
-
},
|
|
85
|
-
"peerDependencies": {
|
|
86
|
-
"jimp": "^0.16.1",
|
|
87
|
-
"link-preview-js": "^3.0.0",
|
|
88
|
-
"qrcode-terminal": "^0.12.0",
|
|
89
|
-
"sharp": "^0.32.2"
|
|
90
|
-
},
|
|
91
|
-
"peerDependenciesMeta": {
|
|
92
|
-
"jimp": {
|
|
93
|
-
"optional": true
|
|
94
|
-
},
|
|
95
|
-
"link-preview-js": {
|
|
96
|
-
"optional": true
|
|
97
|
-
},
|
|
98
|
-
"qrcode-terminal": {
|
|
99
|
-
"optional": true
|
|
100
|
-
},
|
|
101
|
-
"sharp": {
|
|
102
|
-
"optional": true
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"packageManager": "yarn@1.22.19",
|
|
106
|
-
"engines": {
|
|
107
|
-
"node": ">=20.0.0"
|
|
95
|
+
"link-preview-js": {
|
|
96
|
+
"optional": true
|
|
108
97
|
}
|
|
109
|
-
}
|
|
98
|
+
},
|
|
99
|
+
"engines": {
|
|
100
|
+
"node": ">=20.0.0"
|
|
101
|
+
},
|
|
102
|
+
"packageManager": "yarn@1.22.19"
|
|
103
|
+
}
|
package/README.MD
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
# 🚀 WhatsApp Baileys
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<img src="https://raw.githubusercontent.com/FazzCode-Backend/database/refs/heads/main/img/logo/Gemini_Generated_Image_e1100ge1100ge110.png" alt="Thumbnail" width="600px" />
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
<strong>Build powerful WhatsApp automation with ease.</strong><br>
|
|
9
|
-
Developed with ❤️ by <b>FazzCode</b>
|
|
10
|
-
</p>
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 📖 Overview
|
|
15
|
-
|
|
16
|
-
**WhatsApp Baileys** is an open-source library designed to help developers build automation solutions and integrations with WhatsApp efficiently and directly. Using websocket technology without the need for a browser, this library supports a wide range of features such as message management, chat handling, group administration, as well as interactive messages and action buttons for a more dynamic user experience.
|
|
17
|
-
|
|
18
|
-
Actively developed and maintained, baileys continuously receives updates to enhance stability and performance. One of the main focuses is to improve the pairing and authentication processes to be more stable and secure.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## ✨ Main Features & Advantages
|
|
23
|
-
|
|
24
|
-
* **⚡ Lightweight & Fast:** Built on websocket technology without browser overhead.
|
|
25
|
-
* **🔗 Advanced Pairing:** Supports automatic and custom pairing processes with fixed stability.
|
|
26
|
-
* **🎨 Rich Media:** Supports interactive messages, action buttons, and dynamic menus.
|
|
27
|
-
* **📂 Session Management:** Efficient automatic session management for reliable long-term operation.
|
|
28
|
-
* **📱 Multi-Device:** Fully compatible with the latest WhatsApp Multi-Device features.
|
|
29
|
-
* **🛠 Developer Friendly:** Comprehensive documentation and example codes for quick integration.
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## 🚀 Getting Started
|
|
34
|
-
|
|
35
|
-
Begin by installing the library via your preferred package manager:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm install @fazzcode/baileys
|
|
39
|
-
# or
|
|
40
|
-
yarn add @fazzcode/baileys
|
|
41
|
-
Then, follow the configuration guide or utilize the ready-made example codes below to start building your stable, tailored WhatsApp solution.🛠 SendMessage Documentation📸 Album Message (Multiple Images)Send multiple images in a single grouped album:JavaScriptawait sock.sendMessage(jid, {
|
|
42
|
-
albumMessage: [
|
|
43
|
-
{ image: cihuy, caption: "Foto pertama" },
|
|
44
|
-
{ image: { url: "URL IMAGE" }, caption: "Foto kedua" }
|
|
45
|
-
]
|
|
46
|
-
}, { quoted: m });
|
|
47
|
-
📅 Event MessageCreate and send official WhatsApp event invitations:JavaScriptawait sock.sendMessage(jid, {
|
|
48
|
-
eventMessage: {
|
|
49
|
-
isCanceled: false,
|
|
50
|
-
name: "Grand Launching",
|
|
51
|
-
description: "Join our community event!",
|
|
52
|
-
location: { degreesLatitude: 0, degreesLongitude: 0, name: "Jakarta" },
|
|
53
|
-
joinLink: "[https://call.whatsapp.com/video/example](https://call.whatsapp.com/video/example)",
|
|
54
|
-
startTime: "1763019000",
|
|
55
|
-
endTime: "1763026200",
|
|
56
|
-
extraGuestsAllowed: false
|
|
57
|
-
}
|
|
58
|
-
}, { quoted: m });
|
|
59
|
-
📊 Poll Result MessageDisplay live poll results with real-time vote counts:JavaScriptawait sock.sendMessage(jid, {
|
|
60
|
-
pollResultMessage: {
|
|
61
|
-
name: "Favorite Language",
|
|
62
|
-
pollVotes: [
|
|
63
|
-
{ optionName: "JavaScript", optionVoteCount: "112233" },
|
|
64
|
-
{ optionName: "TypeScript", optionVoteCount: "1500" }
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
}, { quoted: m });
|
|
68
|
-
🔘 Interactive Message (CTA Copy)Basic interactive messages with a "Click to Copy" functionality:JavaScriptawait sock.sendMessage(jid, {
|
|
69
|
-
interactiveMessage: {
|
|
70
|
-
title: "Voucher Code",
|
|
71
|
-
footer: "Powered by FazzCode",
|
|
72
|
-
buttons: [
|
|
73
|
-
{
|
|
74
|
-
name: "cta_copy",
|
|
75
|
-
buttonParamsJson: JSON.stringify({
|
|
76
|
-
display_text: "Copy Promo Code",
|
|
77
|
-
id: "promo-123",
|
|
78
|
-
copy_code: "FAZZCODE2026"
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
}, { quoted: m });
|
|
84
|
-
🔗 Product & CatalogSend professional product previews with direct CTA buttons:JavaScriptawait sock.sendMessage(jid, {
|
|
85
|
-
productMessage: {
|
|
86
|
-
title: "Exclusive Bot Script",
|
|
87
|
-
description: "Full feature automation script",
|
|
88
|
-
thumbnail: { url: "[https://example.com/thumb.jpg](https://example.com/thumb.jpg)" },
|
|
89
|
-
productId: "PROD001",
|
|
90
|
-
priceAmount1000: 50000,
|
|
91
|
-
currencyCode: "IDR",
|
|
92
|
-
buttons: [
|
|
93
|
-
{
|
|
94
|
-
name: "cta_url",
|
|
95
|
-
buttonParamsJson: JSON.stringify({
|
|
96
|
-
display_text: "Buy Now",
|
|
97
|
-
url: "[https://fazzcode.com/buy](https://fazzcode.com/buy)"
|
|
98
|
-
})
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
}, { quoted: m });
|
|
103
|
-
📄 Document Message (Buffer)Note: Documents only support buffer input.JavaScriptawait sock.sendMessage(jid, {
|
|
104
|
-
interactiveMessage: {
|
|
105
|
-
title: "Project Documentation",
|
|
106
|
-
footer: "telegram: @stvnnvs",
|
|
107
|
-
document: fs.readFileSync("./manual.pdf"),
|
|
108
|
-
mimetype: "application/pdf",
|
|
109
|
-
fileName: "Manual_Book.pdf",
|
|
110
|
-
buttons: [
|
|
111
|
-
{
|
|
112
|
-
name: "cta_url",
|
|
113
|
-
buttonParamsJson: JSON.stringify({
|
|
114
|
-
display_text: "Support Channel",
|
|
115
|
-
url: "[https://t.me/stvnnvs](https://t.me/stvnnvs)"
|
|
116
|
-
})
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
}, { quoted: m });
|
|
121
|
-
💡 Why Choose This Library?FeatureBenefitHigh StabilityMinimized disconnection issues.Custom PairingMore secure and reliable authentication.Modern APISupports Interactive Buttons, Native Flow, and Polls.Active SupportContinually updated for latest WA versions.📝 Technical NotesSupports custom pairing codes for headless environments.Efficient automatic session management for 24/7 uptime.Perfect for building Customer Service Bots, Notification Systems, and AI Integrations.<p align="center"><b>Thank you for choosing WhatsApp Baileys!</b>Maintenance and updates by <a href="https://www.google.com/search?q=https://github.com/fazzcode">@FazzCode</a></p>
|
package/engine-requirements.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const major = parseInt(process.versions.node.split('.')[0], 10);
|
|
2
|
-
|
|
3
|
-
if (major < 20) {
|
|
4
|
-
console.error(
|
|
5
|
-
`\n❌ This package requires Node.js 20+ to run reliably.\n` +
|
|
6
|
-
` You are using Node.js ${process.versions.node}.\n` +
|
|
7
|
-
` Please upgrade to Node.js 20+ to proceed.\n`
|
|
8
|
-
);
|
|
9
|
-
process.exit(1);
|
|
10
|
-
}
|
package/lib/Defaults/index.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { proto } from '../../WAProto';
|
|
4
|
-
import type { MediaType, SocketConfig } from '../Types';
|
|
5
|
-
export declare const UNAUTHORIZED_CODES: number[];
|
|
6
|
-
export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com";
|
|
7
|
-
export declare const DEF_CALLBACK_PREFIX = "CB:";
|
|
8
|
-
export declare const DEF_TAG_PREFIX = "TAG:";
|
|
9
|
-
export declare const PHONE_CONNECTION_CB = "CB:Pong";
|
|
10
|
-
export declare const WA_DEFAULT_EPHEMERAL: number;
|
|
11
|
-
export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0";
|
|
12
|
-
export declare const DICT_VERSION = 2;
|
|
13
|
-
export declare const KEY_BUNDLE_TYPE: Buffer;
|
|
14
|
-
export declare const NOISE_WA_HEADER: Buffer;
|
|
15
|
-
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
|
16
|
-
export declare const URL_REGEX: RegExp;
|
|
17
|
-
export declare const WA_CERT_DETAILS: {
|
|
18
|
-
SERIAL: number;
|
|
19
|
-
};
|
|
20
|
-
export declare const PROCESSABLE_HISTORY_TYPES: proto.Message.HistorySyncNotification.HistorySyncType[];
|
|
21
|
-
export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig;
|
|
22
|
-
export declare const MEDIA_PATH_MAP: {
|
|
23
|
-
[T in MediaType]?: string;
|
|
24
|
-
};
|
|
25
|
-
export declare const MEDIA_HKDF_KEY_MAPPING: {
|
|
26
|
-
audio: string;
|
|
27
|
-
document: string;
|
|
28
|
-
gif: string;
|
|
29
|
-
image: string;
|
|
30
|
-
ppic: string;
|
|
31
|
-
product: string;
|
|
32
|
-
ptt: string;
|
|
33
|
-
sticker: string;
|
|
34
|
-
video: string;
|
|
35
|
-
'thumbnail-document': string;
|
|
36
|
-
'thumbnail-image': string;
|
|
37
|
-
'thumbnail-video': string;
|
|
38
|
-
'thumbnail-link': string;
|
|
39
|
-
'md-msg-hist': string;
|
|
40
|
-
'md-app-state': string;
|
|
41
|
-
'product-catalog-image': string;
|
|
42
|
-
'payment-bg-image': string;
|
|
43
|
-
ptv: string;
|
|
44
|
-
};
|
|
45
|
-
export declare const MEDIA_KEYS: ("ppic" | "product" | "image" | "video" | "sticker" | "audio" | "gif" | "ptt" | "thumbnail-document" | "thumbnail-image" | "thumbnail-link" | "thumbnail-video" | "md-app-state" | "md-msg-hist" | "document" | "product-catalog-image" | "payment-bg-image" | "ptv")[];
|
|
46
|
-
export declare const MIN_PREKEY_COUNT = 5;
|
|
47
|
-
export declare const INITIAL_PREKEY_COUNT = 30;
|
|
48
|
-
export declare const DEFAULT_CACHE_TTLS: {
|
|
49
|
-
SIGNAL_STORE: number;
|
|
50
|
-
MSG_RETRY: number;
|
|
51
|
-
CALL_OFFER: number;
|
|
52
|
-
USER_DEVICES: number;
|
|
53
|
-
};
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"93": 412,
|
|
3
|
-
"355": 276,
|
|
4
|
-
"213": 603,
|
|
5
|
-
"1-684": 544,
|
|
6
|
-
"376": 213,
|
|
7
|
-
"244": 631,
|
|
8
|
-
"1-264": 365,
|
|
9
|
-
"1-268": 344,
|
|
10
|
-
"54": 722,
|
|
11
|
-
"374": 283,
|
|
12
|
-
"297": 363,
|
|
13
|
-
"61": 505,
|
|
14
|
-
"43": 232,
|
|
15
|
-
"994": 400,
|
|
16
|
-
"1-242": 364,
|
|
17
|
-
"973": 426,
|
|
18
|
-
"880": 470,
|
|
19
|
-
"1-246": 342,
|
|
20
|
-
"375": 257,
|
|
21
|
-
"32": 206,
|
|
22
|
-
"501": 702,
|
|
23
|
-
"229": 616,
|
|
24
|
-
"1-441": 350,
|
|
25
|
-
"975": 402,
|
|
26
|
-
"591": 736,
|
|
27
|
-
"387": 218,
|
|
28
|
-
"267": 652,
|
|
29
|
-
"55": 724,
|
|
30
|
-
"1-284": 348,
|
|
31
|
-
"673": 528,
|
|
32
|
-
"359": 284,
|
|
33
|
-
"226": 613,
|
|
34
|
-
"257": 642,
|
|
35
|
-
"855": 456,
|
|
36
|
-
"237": 624,
|
|
37
|
-
"238": 625,
|
|
38
|
-
"1-345": 346,
|
|
39
|
-
"236": 623,
|
|
40
|
-
"235": 622,
|
|
41
|
-
"56": 730,
|
|
42
|
-
"86": 454,
|
|
43
|
-
"57": 732,
|
|
44
|
-
"269": 654,
|
|
45
|
-
"682": 548,
|
|
46
|
-
"506": 712,
|
|
47
|
-
"385": 219,
|
|
48
|
-
"53": 368,
|
|
49
|
-
"357": 280,
|
|
50
|
-
"420": 230,
|
|
51
|
-
"243": 630,
|
|
52
|
-
"45": 238,
|
|
53
|
-
"253": 638,
|
|
54
|
-
"1-767": 366,
|
|
55
|
-
"1-809": 370,
|
|
56
|
-
"1-849": 370,
|
|
57
|
-
"1-829": 370,
|
|
58
|
-
"593": 740,
|
|
59
|
-
"20": 602,
|
|
60
|
-
"503": 706,
|
|
61
|
-
"240": 627,
|
|
62
|
-
"291": 657,
|
|
63
|
-
"372": 248,
|
|
64
|
-
"251": 636,
|
|
65
|
-
"500": 750,
|
|
66
|
-
"298": 288,
|
|
67
|
-
"679": 542,
|
|
68
|
-
"358": 244,
|
|
69
|
-
"33": 208,
|
|
70
|
-
"689": 547,
|
|
71
|
-
"241": 628,
|
|
72
|
-
"220": 607,
|
|
73
|
-
"995": 282,
|
|
74
|
-
"49": 262,
|
|
75
|
-
"233": 620,
|
|
76
|
-
"350": 266,
|
|
77
|
-
"30": 202,
|
|
78
|
-
"299": 290,
|
|
79
|
-
"1-473": 352,
|
|
80
|
-
"1-671": 535,
|
|
81
|
-
"502": 704,
|
|
82
|
-
"224": 537,
|
|
83
|
-
"592": 738,
|
|
84
|
-
"509": 372,
|
|
85
|
-
"504": 708,
|
|
86
|
-
"852": 454,
|
|
87
|
-
"36": 216,
|
|
88
|
-
"354": 274,
|
|
89
|
-
"91": 404,
|
|
90
|
-
"62": 510,
|
|
91
|
-
"98": 432,
|
|
92
|
-
"964": 418,
|
|
93
|
-
"353": 234,
|
|
94
|
-
"972": 425,
|
|
95
|
-
"39": 222,
|
|
96
|
-
"225": 612,
|
|
97
|
-
"1-876": 338,
|
|
98
|
-
"81": 440,
|
|
99
|
-
"962": 416,
|
|
100
|
-
"254": 639,
|
|
101
|
-
"686": 545,
|
|
102
|
-
"383": 221,
|
|
103
|
-
"965": 419,
|
|
104
|
-
"371": 247,
|
|
105
|
-
"961": 415,
|
|
106
|
-
"266": 651,
|
|
107
|
-
"231": 618,
|
|
108
|
-
"218": 606,
|
|
109
|
-
"423": 295,
|
|
110
|
-
"370": 246,
|
|
111
|
-
"352": 270,
|
|
112
|
-
"389": 294,
|
|
113
|
-
"261": 646,
|
|
114
|
-
"265": 650,
|
|
115
|
-
"60": 502,
|
|
116
|
-
"960": 472,
|
|
117
|
-
"223": 610,
|
|
118
|
-
"356": 278,
|
|
119
|
-
"692": 551,
|
|
120
|
-
"222": 609,
|
|
121
|
-
"230": 617,
|
|
122
|
-
"52": 334,
|
|
123
|
-
"691": 550,
|
|
124
|
-
"373": 259,
|
|
125
|
-
"377": 212,
|
|
126
|
-
"976": 428,
|
|
127
|
-
"382": 297,
|
|
128
|
-
"1-664": 354,
|
|
129
|
-
"212": 604,
|
|
130
|
-
"258": 643,
|
|
131
|
-
"95": 414,
|
|
132
|
-
"264": 649,
|
|
133
|
-
"674": 536,
|
|
134
|
-
"977": 429,
|
|
135
|
-
"31": 204,
|
|
136
|
-
"687": 546,
|
|
137
|
-
"64": 530,
|
|
138
|
-
"505": 710,
|
|
139
|
-
"227": 614,
|
|
140
|
-
"234": 621,
|
|
141
|
-
"683": 555,
|
|
142
|
-
"1-670": 534,
|
|
143
|
-
"47": 242,
|
|
144
|
-
"968": 226,
|
|
145
|
-
"92": 410,
|
|
146
|
-
"680": 552,
|
|
147
|
-
"970": 423,
|
|
148
|
-
"507": 714,
|
|
149
|
-
"675": 537,
|
|
150
|
-
"595": 744,
|
|
151
|
-
"51": 716,
|
|
152
|
-
"63": 515,
|
|
153
|
-
"48": 260,
|
|
154
|
-
"351": 268,
|
|
155
|
-
"1-787, 1-939": 330,
|
|
156
|
-
"974": 427,
|
|
157
|
-
"242": 630,
|
|
158
|
-
"40": 226,
|
|
159
|
-
"7": 250,
|
|
160
|
-
"250": 635,
|
|
161
|
-
"290": 658,
|
|
162
|
-
"1-869": 356,
|
|
163
|
-
"1-758": 358,
|
|
164
|
-
"508": 308,
|
|
165
|
-
"1-784": 360,
|
|
166
|
-
"685": 544,
|
|
167
|
-
"378": 292,
|
|
168
|
-
"239": 626,
|
|
169
|
-
"966": 420,
|
|
170
|
-
"221": 608,
|
|
171
|
-
"381": 220,
|
|
172
|
-
"248": 633,
|
|
173
|
-
"232": 619,
|
|
174
|
-
"65": 525,
|
|
175
|
-
"386": 293,
|
|
176
|
-
"677": 540,
|
|
177
|
-
"27": 655,
|
|
178
|
-
"211": 659,
|
|
179
|
-
"34": 214,
|
|
180
|
-
"94": 413,
|
|
181
|
-
"249": 634,
|
|
182
|
-
"597": 746,
|
|
183
|
-
"268": 653,
|
|
184
|
-
"46": 240,
|
|
185
|
-
"41": 228,
|
|
186
|
-
"963": 417,
|
|
187
|
-
"886": 466,
|
|
188
|
-
"992": 436,
|
|
189
|
-
"255": 640,
|
|
190
|
-
"66": 520,
|
|
191
|
-
"228": 615,
|
|
192
|
-
"690": 554,
|
|
193
|
-
"676": 539,
|
|
194
|
-
"1-868": 374,
|
|
195
|
-
"216": 605,
|
|
196
|
-
"90": 286,
|
|
197
|
-
"993": 438,
|
|
198
|
-
"1-649": 376,
|
|
199
|
-
"688": 553,
|
|
200
|
-
"1-340": 332,
|
|
201
|
-
"256": 641,
|
|
202
|
-
"380": 255,
|
|
203
|
-
"971": 424,
|
|
204
|
-
"44": 234,
|
|
205
|
-
"1": 310,
|
|
206
|
-
"598": 748,
|
|
207
|
-
"998": 434,
|
|
208
|
-
"678": 541,
|
|
209
|
-
"379": 225,
|
|
210
|
-
"58": 734,
|
|
211
|
-
"681": 543,
|
|
212
|
-
"967": 421,
|
|
213
|
-
"260": 645,
|
|
214
|
-
"263": 648,
|
|
215
|
-
"670": 514,
|
|
216
|
-
"245": 632,
|
|
217
|
-
"856": 457,
|
|
218
|
-
"599": 362,
|
|
219
|
-
"850": 467,
|
|
220
|
-
"262": 647,
|
|
221
|
-
"82": 450,
|
|
222
|
-
"84": 452
|
|
223
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare class CiphertextMessage {
|
|
2
|
-
readonly UNSUPPORTED_VERSION: number;
|
|
3
|
-
readonly CURRENT_VERSION: number;
|
|
4
|
-
readonly WHISPER_TYPE: number;
|
|
5
|
-
readonly PREKEY_TYPE: number;
|
|
6
|
-
readonly SENDERKEY_TYPE: number;
|
|
7
|
-
readonly SENDERKEY_DISTRIBUTION_TYPE: number;
|
|
8
|
-
readonly ENCRYPTED_MESSAGE_OVERHEAD: number;
|
|
9
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SenderKeyDistributionMessage } from './sender-key-distribution-message';
|
|
2
|
-
import { SenderKeyName } from './sender-key-name';
|
|
3
|
-
import { SenderKeyRecord } from './sender-key-record';
|
|
4
|
-
interface SenderKeyStore {
|
|
5
|
-
loadSenderKey(senderKeyName: SenderKeyName): Promise<SenderKeyRecord>;
|
|
6
|
-
storeSenderKey(senderKeyName: SenderKeyName, record: SenderKeyRecord): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export declare class GroupSessionBuilder {
|
|
9
|
-
private readonly senderKeyStore;
|
|
10
|
-
constructor(senderKeyStore: SenderKeyStore);
|
|
11
|
-
process(senderKeyName: SenderKeyName, senderKeyDistributionMessage: SenderKeyDistributionMessage): Promise<void>;
|
|
12
|
-
create(senderKeyName: SenderKeyName): Promise<SenderKeyDistributionMessage>;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SenderKeyName } from './sender-key-name';
|
|
2
|
-
import { SenderKeyRecord } from './sender-key-record';
|
|
3
|
-
export interface SenderKeyStore {
|
|
4
|
-
loadSenderKey(senderKeyName: SenderKeyName): Promise<SenderKeyRecord>;
|
|
5
|
-
storeSenderKey(senderKeyName: SenderKeyName, record: SenderKeyRecord): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
export declare class GroupCipher {
|
|
8
|
-
private readonly senderKeyStore;
|
|
9
|
-
private readonly senderKeyName;
|
|
10
|
-
constructor(senderKeyStore: SenderKeyStore, senderKeyName: SenderKeyName);
|
|
11
|
-
private queueJob;
|
|
12
|
-
encrypt(paddedPlaintext: Uint8Array | string): Promise<Uint8Array>;
|
|
13
|
-
decrypt(senderKeyMessageBytes: Uint8Array): Promise<Uint8Array>;
|
|
14
|
-
private getSenderKey;
|
|
15
|
-
private getPlainText;
|
|
16
|
-
private getCipherText;
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { GroupSessionBuilder } from './group-session-builder';
|
|
2
|
-
export { SenderKeyDistributionMessage } from './sender-key-distribution-message';
|
|
3
|
-
export { SenderKeyRecord } from './sender-key-record';
|
|
4
|
-
export { SenderKeyName } from './sender-key-name';
|
|
5
|
-
export { GroupCipher } from './group_cipher';
|
|
6
|
-
export { SenderKeyState } from './sender-key-state';
|
|
7
|
-
export { SenderKeyMessage } from './sender-key-message';
|
|
8
|
-
export { SenderMessageKey } from './sender-message-key';
|
|
9
|
-
export { SenderChainKey } from './sender-chain-key';
|
|
10
|
-
export { CiphertextMessage } from './ciphertext-message';
|
|
11
|
-
export * as keyhelper from './keyhelper';
|