@sanz-0fx/baileys-mod 1.0.3-beta
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 +269 -0
- package/WAProto/fix-import.js +29 -0
- package/WAProto/index.js +97054 -0
- package/engine-requirements.js +10 -0
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.js +147 -0
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Signal/Group/ciphertext-message.js +15 -0
- package/lib/Signal/Group/group-session-builder.js +64 -0
- package/lib/Signal/Group/group_cipher.js +96 -0
- package/lib/Signal/Group/index.js +57 -0
- package/lib/Signal/Group/keyhelper.js +55 -0
- package/lib/Signal/Group/queue-job.js +57 -0
- package/lib/Signal/Group/sender-chain-key.js +34 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js +69 -0
- package/lib/Signal/Group/sender-key-name.js +51 -0
- package/lib/Signal/Group/sender-key-record.js +53 -0
- package/lib/Signal/Group/sender-key-state.js +99 -0
- package/lib/Signal/Group/sender-message-key.js +29 -0
- package/lib/Signal/libsignal.js +174 -0
- package/lib/Socket/Client/abstract-socket-client.js +13 -0
- package/lib/Socket/Client/index.js +19 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/web-socket-client.js +62 -0
- package/lib/Socket/business.js +320 -0
- package/lib/Socket/chats.js +993 -0
- package/lib/Socket/communities.js +421 -0
- package/lib/Socket/groups.js +381 -0
- package/lib/Socket/index.js +11 -0
- package/lib/Socket/luxu.js +541 -0
- package/lib/Socket/messages-recv.js +1110 -0
- package/lib/Socket/messages-send.js +1107 -0
- package/lib/Socket/newsletter.js +308 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.js +736 -0
- package/lib/Socket/usync.js +70 -0
- package/lib/Store/index.js +10 -0
- package/lib/Store/make-cache-manager-store.js +83 -0
- package/lib/Store/make-in-memory-store.js +427 -0
- package/lib/Store/make-ordered-dictionary.js +81 -0
- package/lib/Store/object-repository.js +27 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.js +4 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.js +27 -0
- package/lib/Types/LabelAssociation.js +9 -0
- package/lib/Types/Message.js +9 -0
- package/lib/Types/Newsletter.js +38 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.js +2 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.js +42 -0
- package/lib/Utils/auth-utils.js +206 -0
- package/lib/Utils/baileys-event-stream.js +63 -0
- package/lib/Utils/business.js +234 -0
- package/lib/Utils/chat-utils.js +729 -0
- package/lib/Utils/crypto.js +151 -0
- package/lib/Utils/decode-wa-message.js +198 -0
- package/lib/Utils/event-buffer.js +514 -0
- package/lib/Utils/generics.js +423 -0
- package/lib/Utils/history.js +96 -0
- package/lib/Utils/index.js +33 -0
- package/lib/Utils/link-preview.js +93 -0
- package/lib/Utils/logger.js +7 -0
- package/lib/Utils/lt-hash.js +51 -0
- package/lib/Utils/make-mutex.js +43 -0
- package/lib/Utils/messages-media.js +819 -0
- package/lib/Utils/messages.js +827 -0
- package/lib/Utils/noise-handler.js +155 -0
- package/lib/Utils/process-message.js +321 -0
- package/lib/Utils/signal.js +153 -0
- package/lib/Utils/use-multi-file-auth-state.js +119 -0
- package/lib/Utils/validate-connection.js +229 -0
- package/lib/WABinary/constants.js +40 -0
- package/lib/WABinary/decode.js +252 -0
- package/lib/WABinary/encode.js +265 -0
- package/lib/WABinary/generic-utils.js +198 -0
- package/lib/WABinary/index.js +21 -0
- package/lib/WABinary/jid-utils.js +62 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.js +13 -0
- package/lib/WAM/constants.js +15350 -0
- package/lib/WAM/encode.js +155 -0
- package/lib/WAM/index.js +19 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
- package/lib/WAUSync/Protocols/index.js +20 -0
- package/lib/WAUSync/USyncQuery.js +89 -0
- package/lib/WAUSync/USyncUser.js +26 -0
- package/lib/WAUSync/index.js +19 -0
- package/lib/index.js +38 -0
- package/package.json +105 -0
package/README.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
# Modified Whatsapp-API
|
|
2
|
+
<p align='center'>
|
|
3
|
+
<img src="https://files.catbox.moe/rhm9rt.webp" width="172">
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
```json
|
|
10
|
+
"depencies": {
|
|
11
|
+
"@whiskeysockets/baileys": "npm:@zeppeliorg/wbails"
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
## Import
|
|
15
|
+
```javascript
|
|
16
|
+
const {
|
|
17
|
+
default:makeWASocket,
|
|
18
|
+
// Other Options
|
|
19
|
+
} = require('@whiskeysockets/baileys');
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
# How To Connect To Whatsapp
|
|
24
|
+
## With QR Code
|
|
25
|
+
```javascript
|
|
26
|
+
const {
|
|
27
|
+
default: makeWASocket
|
|
28
|
+
} = require('@whiskeysockets/baileys');
|
|
29
|
+
|
|
30
|
+
const client = makeWASocket({
|
|
31
|
+
browser: ['Ubuntu', 'Chrome', '20.00.1'],
|
|
32
|
+
printQRInTerminal: true
|
|
33
|
+
})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Connect With Number
|
|
37
|
+
```javascript
|
|
38
|
+
const {
|
|
39
|
+
default: makeWASocket,
|
|
40
|
+
fetchLatestWAWebVersion
|
|
41
|
+
} = require('@whiskeysockets/baileys');
|
|
42
|
+
|
|
43
|
+
const client = makeWASocket({
|
|
44
|
+
browser: ['Ubuntu', 'Chrome', '20.00.1'],
|
|
45
|
+
printQRInTerminal: false,
|
|
46
|
+
version: fetchLatestWAWebVersion()
|
|
47
|
+
// Other options
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const number = "628XXXXX";
|
|
51
|
+
const code = await client.requestPairingCode(number.trim) /* Use : (number, "YYYYYYYY") for custom-pairing */
|
|
52
|
+
|
|
53
|
+
console.log("Ur pairing code : " + code)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
# Sending messages
|
|
57
|
+
|
|
58
|
+
## send orderMessage
|
|
59
|
+
```javascript
|
|
60
|
+
const fs = require('fs');
|
|
61
|
+
const ZeppImg = fs.readFileSync('./ZeppImage');
|
|
62
|
+
|
|
63
|
+
await client.sendMessage(m.chat, {
|
|
64
|
+
thumbnail: ZeppImg,
|
|
65
|
+
message: "Gotta get a grip",
|
|
66
|
+
orderTitle: "7eppeli-Corporation",
|
|
67
|
+
totalAmount1000: 72502,
|
|
68
|
+
totalCurrencyCode: "IDR"
|
|
69
|
+
}, { quoted:m })
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## send pollResultSnapshotMessage
|
|
73
|
+
```javascript
|
|
74
|
+
await client.sendMessage(m.chat, {
|
|
75
|
+
pollResultMessage: {
|
|
76
|
+
name: "7eppeli-Corporation",
|
|
77
|
+
options: [
|
|
78
|
+
{
|
|
79
|
+
optionName: "poll 1"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
optionName: "poll 2"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
newsletter: {
|
|
86
|
+
newsletterName: "7eppeli | Killer Queen Information",
|
|
87
|
+
newsletterJid: "1@newsletter"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## send productMessage
|
|
94
|
+
```javascript
|
|
95
|
+
await client.relayMessage(m.chat, {
|
|
96
|
+
productMessage {
|
|
97
|
+
title: "7eppeli.pdf",
|
|
98
|
+
description: "zZZ...",
|
|
99
|
+
thumbnail: { url: "./ZeppImage" },
|
|
100
|
+
productId: "EXAMPLE_TOKEN",
|
|
101
|
+
retailerId: "EXAMPLE_RETAILER_ID",
|
|
102
|
+
url: "https://t.me/YuukeyD7eppeli",
|
|
103
|
+
body: "Nak Tido",
|
|
104
|
+
footer: "Footer",
|
|
105
|
+
buttons: [
|
|
106
|
+
{
|
|
107
|
+
name: "cta_url",
|
|
108
|
+
buttonParamsJson: "{\"display_text\":\"7eppeli-Pdf\",\"url\":\"https://t.me/YuukeyD7eppeli\"}"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
priceAmount1000: 72502,
|
|
112
|
+
currencyCode: "IDR"
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## send member label
|
|
118
|
+
```javascript
|
|
119
|
+
await client.sendMessage(m.chat, {
|
|
120
|
+
groupLabel: {
|
|
121
|
+
labelText: "Tag anggota tercantum di sini"
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## send message to members in group
|
|
127
|
+
```javascript
|
|
128
|
+
await client.sendMessageMembers(m.chat, {
|
|
129
|
+
extendedTextMessage: {
|
|
130
|
+
text: "save aku 7epsync"
|
|
131
|
+
}
|
|
132
|
+
}, {})
|
|
133
|
+
```
|
|
134
|
+
# Simple sendMessage
|
|
135
|
+
|
|
136
|
+
## send text
|
|
137
|
+
```javascript
|
|
138
|
+
await client.sendText(m.chat, "7eppsynC", {
|
|
139
|
+
contextInfo: {
|
|
140
|
+
mentionedJid: [m.chat]
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
key: {
|
|
144
|
+
remoteJid: "status@broadcast",
|
|
145
|
+
participant: m.sender,
|
|
146
|
+
fromMe: true
|
|
147
|
+
},
|
|
148
|
+
message: {
|
|
149
|
+
conversation: "\0"
|
|
150
|
+
}
|
|
151
|
+
})
|
|
152
|
+
```
|
|
153
|
+
## send image
|
|
154
|
+
```javascript
|
|
155
|
+
await client.sendImage(m.chat, { url: "./zepy.jpg" }, "7eppsynC", {
|
|
156
|
+
contextInfo: {
|
|
157
|
+
mentionedJid: [m.chat]
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
key: {
|
|
161
|
+
remoteJid: "status@broadcast",
|
|
162
|
+
participant: m.sender,
|
|
163
|
+
fromMe: true
|
|
164
|
+
},
|
|
165
|
+
message: {
|
|
166
|
+
conversation: "\0"
|
|
167
|
+
}
|
|
168
|
+
})
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## send video
|
|
172
|
+
```javascript
|
|
173
|
+
await client.sendVideo(m.chat, { url: "./zepy.mp4" }, "7eppsynC", {
|
|
174
|
+
contextInfo: {
|
|
175
|
+
mentionedJid: [m.chat]
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
key: {
|
|
179
|
+
remoteJid: "status@broadcast",
|
|
180
|
+
participant: m.sender,
|
|
181
|
+
fromMe: true
|
|
182
|
+
},
|
|
183
|
+
message: {
|
|
184
|
+
conversation: "\0"
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## send audio
|
|
190
|
+
```javascript
|
|
191
|
+
await client.sendAudio(m.chat, { url: "./zepy.mp3" }, {
|
|
192
|
+
contextInfo: {
|
|
193
|
+
mentionedJid: [m.chat]
|
|
194
|
+
}
|
|
195
|
+
}, {
|
|
196
|
+
key: {
|
|
197
|
+
remoteJid: "status@broadcast",
|
|
198
|
+
participant: m.sender,
|
|
199
|
+
fromMe: true
|
|
200
|
+
},
|
|
201
|
+
message: {
|
|
202
|
+
conversation: "\0"
|
|
203
|
+
}
|
|
204
|
+
})
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## send location
|
|
208
|
+
```javascript
|
|
209
|
+
await client.sendLocation(m.chat, "7eppsynC", 90.0, 90.0, "https://t.me/XzC_Info", "1234567890", {
|
|
210
|
+
contextInfo: {
|
|
211
|
+
mentionedJid: [m.chat]
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
key: {
|
|
215
|
+
remoteJid: "status@broadcast",
|
|
216
|
+
participant: m.sender,
|
|
217
|
+
fromMe: true
|
|
218
|
+
},
|
|
219
|
+
message: {
|
|
220
|
+
conversation: "\0"
|
|
221
|
+
}
|
|
222
|
+
})
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## send polling
|
|
226
|
+
```javascript
|
|
227
|
+
await client.sendPoll(m.chat, "7eppsynC", ["1", "2", "3"], true, {
|
|
228
|
+
contextInfo: {
|
|
229
|
+
mentionedJid: [m.chat]
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
key: {
|
|
233
|
+
remoteJid: "status@broadcast",
|
|
234
|
+
participant: m.sender,
|
|
235
|
+
fromMe: true
|
|
236
|
+
},
|
|
237
|
+
message: {
|
|
238
|
+
conversation: "\0"
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## send quiz
|
|
244
|
+
```javascript
|
|
245
|
+
await client.sendQuiz(m.chat, "7eppsynC", ["1", "2", "3"], "2", {
|
|
246
|
+
contextInfo: {
|
|
247
|
+
mentionedJid: [m.chat]
|
|
248
|
+
}
|
|
249
|
+
}, {
|
|
250
|
+
key: {
|
|
251
|
+
remoteJid: "status@broadcast",
|
|
252
|
+
participant: m.sender,
|
|
253
|
+
fromMe: true
|
|
254
|
+
},
|
|
255
|
+
message: {
|
|
256
|
+
conversation: "\0"
|
|
257
|
+
}
|
|
258
|
+
})
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## send status mention
|
|
262
|
+
```javascript
|
|
263
|
+
await client.statusMention(m.chat, {
|
|
264
|
+
extendedTextMessage: {
|
|
265
|
+
text: "7eppsynC"
|
|
266
|
+
}
|
|
267
|
+
})
|
|
268
|
+
```
|
|
269
|
+
Follow https://t.me/XzC_Info kalau mau liat type message yg lain :v
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const { readFileSync, writeFileSync } = require 'fs';
|
|
2
|
+
const { exit } = require 'process';
|
|
3
|
+
|
|
4
|
+
const filePath = './index.js';
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
// Read the file
|
|
8
|
+
let content = readFileSync(filePath, 'utf8');
|
|
9
|
+
|
|
10
|
+
// Fix the import statement
|
|
11
|
+
content = content.replace(
|
|
12
|
+
/import \* as (\$protobuf) from/g,
|
|
13
|
+
'import $1 from'
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
// add missing extension to the import
|
|
17
|
+
content = content.replace(
|
|
18
|
+
/(['"])protobufjs\/minimal(['"])/g,
|
|
19
|
+
'$1protobufjs/minimal.js$2'
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
// Write back
|
|
23
|
+
writeFileSync(filePath, content, 'utf8');
|
|
24
|
+
|
|
25
|
+
console.log(`✅ Fixed imports in ${filePath}`);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error(`❌ Error fixing imports: ${error.message}`);
|
|
28
|
+
exit(1);
|
|
29
|
+
}
|