fixo-baileys 1.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/LICENSE +21 -0
- package/README.md +431 -0
- package/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +5479 -0
- package/WAProto/fix-imports.js +85 -0
- package/WAProto/index.d.ts +14017 -0
- package/WAProto/index.js +97691 -0
- package/engine-requirements.js +10 -0
- package/lib/Defaults/index.js +129 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/group-session-builder.js +30 -0
- package/lib/Signal/Group/group_cipher.js +82 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/keyhelper.js +18 -0
- package/lib/Signal/Group/sender-chain-key.js +26 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
- package/lib/Signal/Group/sender-key-message.js +66 -0
- package/lib/Signal/Group/sender-key-name.js +48 -0
- package/lib/Signal/Group/sender-key-record.js +41 -0
- package/lib/Signal/Group/sender-key-state.js +84 -0
- package/lib/Signal/Group/sender-message-key.js +26 -0
- package/lib/Signal/libsignal.js +431 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Socket/Client/index.js +3 -0
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/websocket.js +54 -0
- package/lib/Socket/business.js +379 -0
- package/lib/Socket/chats.js +1198 -0
- package/lib/Socket/communities.js +431 -0
- package/lib/Socket/groups.js +347 -0
- package/lib/Socket/index.js +12 -0
- package/lib/Socket/messages-recv.js +1772 -0
- package/lib/Socket/messages-send.js +1408 -0
- package/lib/Socket/mex.js +42 -0
- package/lib/Socket/newsletter.js +419 -0
- package/lib/Socket/socket.js +999 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.js +8 -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 +25 -0
- package/lib/Types/LabelAssociation.js +7 -0
- package/lib/Types/Message.js +11 -0
- package/lib/Types/Mex.js +37 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.js +3 -0
- package/lib/Types/State.js +56 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.js +26 -0
- package/lib/Types/temp +1 -0
- package/lib/Utils/auth-utils.js +302 -0
- package/lib/Utils/browser-utils.js +29 -0
- package/lib/Utils/business.js +231 -0
- package/lib/Utils/chat-utils.js +872 -0
- package/lib/Utils/companion-reg-client-utils.js +35 -0
- package/lib/Utils/crypto.js +118 -0
- package/lib/Utils/decode-wa-message.js +317 -0
- package/lib/Utils/event-buffer.js +622 -0
- package/lib/Utils/generics.js +393 -0
- package/lib/Utils/history.js +134 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/index.js +22 -0
- package/lib/Utils/link-preview.js +85 -0
- package/lib/Utils/logger.js +3 -0
- package/lib/Utils/lt-hash.js +8 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/message-retry-manager.js +265 -0
- package/lib/Utils/messages-media.js +795 -0
- package/lib/Utils/messages.js +1056 -0
- package/lib/Utils/noise-handler.js +201 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/process-message.js +630 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/signal.js +201 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/tc-token-utils.js +164 -0
- package/lib/Utils/use-multi-file-auth-state.js +121 -0
- package/lib/Utils/validate-connection.js +210 -0
- package/lib/WABinary/constants.js +1301 -0
- package/lib/WABinary/decode.js +262 -0
- package/lib/WABinary/encode.js +220 -0
- package/lib/WABinary/generic-utils.js +113 -0
- package/lib/WABinary/index.js +6 -0
- package/lib/WABinary/jid-utils.js +96 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.js +10 -0
- package/lib/WAM/constants.js +22853 -0
- package/lib/WAM/encode.js +150 -0
- package/lib/WAM/index.js +4 -0
- package/lib/WAM/temp +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/lib/WAUSync/Protocols/index.js +6 -0
- package/lib/WAUSync/USyncQuery.js +98 -0
- package/lib/WAUSync/USyncUser.js +31 -0
- package/lib/WAUSync/index.js +4 -0
- package/lib/index.js +11 -0
- package/package.json +79 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Rajeh Taher/WhiskeySockets
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://github.com/user-attachments/assets/a55539bd-768a-4d89-a4cf-c22fff7315d1" alt="FIXO-BAILEYS" height="300" />
|
|
3
|
+
|
|
4
|
+
<p>A <b>Professional</b>, <b>Highly Optimized</b> & <b>Clean</b> WebSocket-based JavaScript library for interacting with the WhatsApp Web API.</p>
|
|
5
|
+
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://github.com/Fixo123/FIXO-BAILEYES-"><img title="Blazing Fast" src="https://img.shields.io/badge/Speed-Blazing%20Fast-orange?style=for-the-badge&logo=fastly"></a>
|
|
8
|
+
<a href="https://github.com/Fixo123/FIXO-BAILEYES-"><img title="Version" src="https://img.shields.io/badge/Version-1.0.0-blue?style=for-the-badge"></a>
|
|
9
|
+
<a href="https://github.com/Fixo123/FIXO-BAILEYES-/blob/main/LICENSE"><img title="License" src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge"></a>
|
|
10
|
+
<a href="https://github.com/Fixo123/FIXO-BAILEYES-"><img title="Stars" src="https://img.shields.io/github/stars/Akashkavindu/FIXO-BAILEYS?style=for-the-badge&color=yellow"></a>
|
|
11
|
+
<a href="https://github.com/Fixo123/FIXO-BAILEYES-"><img title="Forks" src="https://img.shields.io/github/forks/Akashkavindu/FIXO-BAILEYS?style=for-the-badge&color=purple"></a>
|
|
12
|
+
<a href="https://github.com/Fixo123/FIXO-BAILEYES-"><img title="Issues" src="https://img.shields.io/github/issues/Akashkavindu/FIXO-BAILEYS?style=for-the-badge&color=red"></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p>
|
|
16
|
+
<a href="#-overview">Overview</a> •
|
|
17
|
+
<a href="#-features">Features</a> •
|
|
18
|
+
<a href="#-installation">Installation</a> •
|
|
19
|
+
<a href="#-connecting">Connect Bot</a> •
|
|
20
|
+
<a href="#-buttons">Buttons</a> •
|
|
21
|
+
<a href="#-channel-media">Channel Media</a> •
|
|
22
|
+
<a href="#-core-api">Core API</a> •
|
|
23
|
+
<a href="#-support">Support</a>
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🌟 Overview
|
|
30
|
+
|
|
31
|
+
**FIXO-BAILEYS** is a modified, **100% pure & clean custom fork** of Baileys. All hidden tracking endpoints, background data collection, and annoying developer auto-follow newsletter scripts have been completely stripped out to ensure maximum privacy, safety, and background performance for your automated bots.
|
|
32
|
+
|
|
33
|
+
Optimized specifically to power the **FIXO-MINI** WhatsApp bot framework.
|
|
34
|
+
|
|
35
|
+
> [!NOTE]
|
|
36
|
+
> This fork is **not** a rewrite — it's a drop-in replacement. All original Baileys APIs work exactly the same way.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## ⚡ Features
|
|
41
|
+
|
|
42
|
+
<div align="center">
|
|
43
|
+
|
|
44
|
+
| Feature | Description | Status |
|
|
45
|
+
|:---|:---|:---:|
|
|
46
|
+
| 📦 **2GB Large File Streaming** | Seamless streaming & direct upload/download of large files up to **2GB** without exhausting server RAM | ✅ |
|
|
47
|
+
| 🚀 **Deep Performance** | Lightweight structure optimized for **low-spec hosting** servers & automated business workflows | ✅ |
|
|
48
|
+
| 🎨 **Interactive Buttons** | Full support for **buttons**, **list messages**, **template buttons** & interactive UI | ✅ |
|
|
49
|
+
| 📢 **Channel Media Send** | Send images, videos, audio & documents directly to **WhatsApp Channels** | ✅ |
|
|
50
|
+
| ⚡ **Fast Response** | Optimized message handling for **instant replies** with minimal latency | ✅ |
|
|
51
|
+
| 📱 **Multi-Device** | Supports WhatsApp **Multi-Device** & Web versions | ✅ |
|
|
52
|
+
| 🔐 **Signal Protocol** | End-to-end encryption via **libsignal** protocol | ✅ |
|
|
53
|
+
| 🎭 **Custom Pairing** | Connect via **QR Code** or **Pairing Code** | ✅ |
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 📦 Installation
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm install fixo-baileys
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 🔌 Connecting
|
|
68
|
+
|
|
69
|
+
### 📱 Method 1: QR Code
|
|
70
|
+
|
|
71
|
+
```javascript
|
|
72
|
+
import makeWASocket, { useMultiFileAuthState } from 'fixo-baileys'
|
|
73
|
+
import P from 'pino'
|
|
74
|
+
|
|
75
|
+
async function startBot() {
|
|
76
|
+
const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys')
|
|
77
|
+
|
|
78
|
+
const sock = makeWASocket({
|
|
79
|
+
auth: state,
|
|
80
|
+
logger: P({ level: 'silent' }),
|
|
81
|
+
printQRInTerminal: true,
|
|
82
|
+
browser: ['FIXO-BAILEYS', 'Chrome', '1.0.0']
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
sock.ev.on('creds.update', saveCreds)
|
|
86
|
+
|
|
87
|
+
sock.ev.on('connection.update', ({ connection }) => {
|
|
88
|
+
if (connection === 'open') {
|
|
89
|
+
console.log('✅ Bot connected!')
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
return sock
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
startBot()
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 🔢 Method 2: Pairing Code
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
import makeWASocket, { useMultiFileAuthState } from 'fixo-baileys'
|
|
103
|
+
import P from 'pino'
|
|
104
|
+
|
|
105
|
+
async function startBotWithPairing() {
|
|
106
|
+
const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys')
|
|
107
|
+
|
|
108
|
+
const sock = makeWASocket({
|
|
109
|
+
auth: state,
|
|
110
|
+
logger: P({ level: 'silent' }),
|
|
111
|
+
printQRInTerminal: false,
|
|
112
|
+
browser: ['FIXO-BAILEYS', 'Chrome', '1.0.0']
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
if (!sock.authState.creds.registered) {
|
|
116
|
+
const phoneNumber = '94771234567'
|
|
117
|
+
const pairingCode = await sock.requestPairingCode(phoneNumber)
|
|
118
|
+
console.log('🔢 Your Pairing Code:', pairingCode)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
sock.ev.on('creds.update', saveCreds)
|
|
122
|
+
|
|
123
|
+
sock.ev.on('connection.update', ({ connection }) => {
|
|
124
|
+
if (connection === 'open') {
|
|
125
|
+
console.log('✅ Bot connected via pairing code!')
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
return sock
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
startBotWithPairing()
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 🔄 Auto Reconnect
|
|
136
|
+
|
|
137
|
+
```javascript
|
|
138
|
+
import makeWASocket, {
|
|
139
|
+
useMultiFileAuthState,
|
|
140
|
+
DisconnectReason,
|
|
141
|
+
fetchLatestBaileysVersion
|
|
142
|
+
} from 'fixo-baileys'
|
|
143
|
+
import { Boom } from '@hapi/boom'
|
|
144
|
+
import P from 'pino'
|
|
145
|
+
|
|
146
|
+
async function connectToWhatsApp() {
|
|
147
|
+
const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys')
|
|
148
|
+
const { version } = await fetchLatestBaileysVersion()
|
|
149
|
+
|
|
150
|
+
const sock = makeWASocket({
|
|
151
|
+
version,
|
|
152
|
+
auth: state,
|
|
153
|
+
logger: P({ level: 'silent' }),
|
|
154
|
+
printQRInTerminal: true,
|
|
155
|
+
browser: ['FIXO-BAILEYS', 'Chrome', '1.0.0'],
|
|
156
|
+
defaultQueryTimeoutMs: 120000,
|
|
157
|
+
connectTimeoutMs: 60000,
|
|
158
|
+
enableAutoSessionRecreation: true,
|
|
159
|
+
markOnlineOnConnect: false,
|
|
160
|
+
syncFullHistory: false,
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
sock.ev.on('connection.update', (update) => {
|
|
164
|
+
const { connection, lastDisconnect } = update
|
|
165
|
+
|
|
166
|
+
if (connection === 'close') {
|
|
167
|
+
const statusCode = (lastDisconnect?.error as Boom)?.output?.statusCode
|
|
168
|
+
const shouldReconnect = statusCode !== DisconnectReason.loggedOut
|
|
169
|
+
|
|
170
|
+
console.log(`❌ Disconnected. Code: ${statusCode}`)
|
|
171
|
+
|
|
172
|
+
if (shouldReconnect) {
|
|
173
|
+
setTimeout(() => connectToWhatsApp(), 3000)
|
|
174
|
+
} else {
|
|
175
|
+
console.log('🚪 Logged out. Please scan QR again.')
|
|
176
|
+
}
|
|
177
|
+
} else if (connection === 'open') {
|
|
178
|
+
console.log('✅ Connected to WhatsApp!')
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
sock.ev.on('creds.update', saveCreds)
|
|
183
|
+
|
|
184
|
+
return sock
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
connectToWhatsApp()
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 🎨 Buttons
|
|
193
|
+
|
|
194
|
+
### 🔘 Simple Buttons
|
|
195
|
+
|
|
196
|
+
```javascript
|
|
197
|
+
await sock.sendMessage(jid, {
|
|
198
|
+
text: '🎯 *Choose an option:*',
|
|
199
|
+
footer: 'FIXO-BAILEYS',
|
|
200
|
+
buttons: [
|
|
201
|
+
{
|
|
202
|
+
buttonId: 'btn_yes',
|
|
203
|
+
buttonText: { displayText: '✅ Yes' },
|
|
204
|
+
type: 1
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
buttonId: 'btn_no',
|
|
208
|
+
buttonText: { displayText: '❌ No' },
|
|
209
|
+
type: 1
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
buttonId: 'btn_maybe',
|
|
213
|
+
buttonText: { displayText: '🤔 Maybe' },
|
|
214
|
+
type: 1
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
headerType: 1
|
|
218
|
+
}, { quoted: m })
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### 🔗 URL Buttons
|
|
222
|
+
|
|
223
|
+
```javascript
|
|
224
|
+
await sock.sendMessage(jid, {
|
|
225
|
+
text: '🌐 *Visit our website:*',
|
|
226
|
+
footer: 'FIXO-BAILEYS',
|
|
227
|
+
buttons: [
|
|
228
|
+
{
|
|
229
|
+
buttonId: 'url_btn',
|
|
230
|
+
buttonText: { displayText: '🌐 Open Website' },
|
|
231
|
+
type: 1
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
headerType: 1
|
|
235
|
+
})
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### 📋 List Message (Menu)
|
|
239
|
+
|
|
240
|
+
```javascript
|
|
241
|
+
await sock.sendMessage(jid, {
|
|
242
|
+
text: '📋 *Main Menu*\n\nPlease select an option below:',
|
|
243
|
+
footer: '© FIXO-BAILEYS',
|
|
244
|
+
title: '🎯 Bot Menu',
|
|
245
|
+
buttonText: '📂 Open Menu',
|
|
246
|
+
sections: [
|
|
247
|
+
{
|
|
248
|
+
title: '👤 User Commands',
|
|
249
|
+
rows: [
|
|
250
|
+
{ title: '👤 My Profile', rowId: 'cmd_profile', description: 'View your profile' },
|
|
251
|
+
{ title: '⚙️ Settings', rowId: 'cmd_settings', description: 'Change settings' },
|
|
252
|
+
{ title: '📊 Statistics', rowId: 'cmd_stats', description: 'View bot stats' }
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
title: '🎮 Fun Commands',
|
|
257
|
+
rows: [
|
|
258
|
+
{ title: '🎲 Roll Dice', rowId: 'cmd_dice' },
|
|
259
|
+
{ title: '🎰 Spin Wheel', rowId: 'cmd_spin' },
|
|
260
|
+
{ title: '🎯 Truth or Dare', rowId: 'cmd_tod' }
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
title: '🛠️ Admin Commands',
|
|
265
|
+
rows: [
|
|
266
|
+
{ title: '🔨 Ban User', rowId: 'cmd_ban' },
|
|
267
|
+
{ title: '📢 Broadcast', rowId: 'cmd_broadcast' }
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}, { quoted: m })
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### 📨 Handle Button Responses
|
|
275
|
+
|
|
276
|
+
```javascript
|
|
277
|
+
sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
278
|
+
const m = messages[0]
|
|
279
|
+
if (!m.message) return
|
|
280
|
+
|
|
281
|
+
const buttonResponse = m.message?.buttonsResponseMessage
|
|
282
|
+
if (buttonResponse) {
|
|
283
|
+
const selectedId = buttonResponse.selectedButtonId
|
|
284
|
+
const selectedText = buttonResponse.selectedDisplayText
|
|
285
|
+
|
|
286
|
+
console.log(`User clicked: ${selectedId} (${selectedText})`)
|
|
287
|
+
|
|
288
|
+
switch (selectedId) {
|
|
289
|
+
case 'btn_yes':
|
|
290
|
+
await sock.sendMessage(m.key.remoteJid, { text: '✅ You said YES!' })
|
|
291
|
+
break
|
|
292
|
+
case 'btn_no':
|
|
293
|
+
await sock.sendMessage(m.key.remoteJid, { text: '❌ You said NO!' })
|
|
294
|
+
break
|
|
295
|
+
case 'btn_maybe':
|
|
296
|
+
await sock.sendMessage(m.key.remoteJid, { text: '🤔 Maybe...' })
|
|
297
|
+
break
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const listResponse = m.message?.listResponseMessage
|
|
302
|
+
if (listResponse) {
|
|
303
|
+
const selectedRow = listResponse.singleSelectReply?.selectedRowId
|
|
304
|
+
console.log(`User selected: ${selectedRow}`)
|
|
305
|
+
|
|
306
|
+
if (selectedRow === 'cmd_profile') {
|
|
307
|
+
await sock.sendMessage(m.key.remoteJid, { text: '👤 *Your Profile*\nName: User' })
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const templateResponse = m.message?.templateButtonReplyMessage
|
|
312
|
+
if (templateResponse) {
|
|
313
|
+
console.log(`Template clicked: ${templateResponse.selectedId}`)
|
|
314
|
+
}
|
|
315
|
+
})
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## 📢 Channel Media
|
|
321
|
+
|
|
322
|
+
### 🎵 Send Audio to Channel
|
|
323
|
+
|
|
324
|
+
```javascript
|
|
325
|
+
await sock.newsletterSendMedia(channelJid, {
|
|
326
|
+
audio: { url: 'https://example.com/audio.mp3' },
|
|
327
|
+
mimetype: 'audio/mp3',
|
|
328
|
+
ptt: false
|
|
329
|
+
})
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## 💖 Send Reaction
|
|
335
|
+
|
|
336
|
+
```javascript
|
|
337
|
+
await sock.sendMessage(jid, {
|
|
338
|
+
react: {
|
|
339
|
+
text: '❤️',
|
|
340
|
+
key: m.key
|
|
341
|
+
}
|
|
342
|
+
})
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## 🛠️ Core API
|
|
348
|
+
|
|
349
|
+
### 📨 Messaging
|
|
350
|
+
|
|
351
|
+
```javascript
|
|
352
|
+
await sock.sendMessage(jid, { text: 'Hi' }) // Text
|
|
353
|
+
await sock.sendMessage(jid, { image: { url } }) // Image
|
|
354
|
+
await sock.sendMessage(jid, { video: { url } }) // Video
|
|
355
|
+
await sock.sendMessage(jid, { audio: { url } }) // Audio
|
|
356
|
+
await sock.sendMessage(jid, { document: { url } }) // Document
|
|
357
|
+
await sock.sendMessage(jid, { sticker: { url } }) // Sticker
|
|
358
|
+
await sock.sendMessage(jid, { react: { text, key } }) // Reaction
|
|
359
|
+
await sock.sendMessage(jid, { delete: msg.key }) // Delete
|
|
360
|
+
await sock.sendMessage(jid, { edit: msg.key, text }) // Edit
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### 👥 Groups
|
|
364
|
+
|
|
365
|
+
```javascript
|
|
366
|
+
await sock.groupCreate(name, participants)
|
|
367
|
+
await sock.groupParticipantsUpdate(jid, [user], 'add')
|
|
368
|
+
await sock.groupUpdateSubject(jid, 'New Name')
|
|
369
|
+
await sock.groupUpdateDescription(jid, 'New Desc')
|
|
370
|
+
await sock.groupSettingUpdate(jid, 'announcement')
|
|
371
|
+
await sock.groupLeave(jid)
|
|
372
|
+
await sock.groupMetadata(jid)
|
|
373
|
+
await sock.groupInviteCode(jid)
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## 🔐 Session Management
|
|
379
|
+
|
|
380
|
+
```javascript
|
|
381
|
+
import { useMultiFileAuthState } from 'fixo-baileys'
|
|
382
|
+
|
|
383
|
+
const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys')
|
|
384
|
+
|
|
385
|
+
const sock = makeWASocket({ auth: state })
|
|
386
|
+
|
|
387
|
+
sock.ev.on('creds.update', saveCreds)
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## 📚 Documentation
|
|
393
|
+
|
|
394
|
+
### Events
|
|
395
|
+
|
|
396
|
+
| Event | Description |
|
|
397
|
+
|:---|:---|
|
|
398
|
+
| `connection.update` | Connection state changes (open, close, connecting) |
|
|
399
|
+
| `creds.update` | Authentication credentials updated |
|
|
400
|
+
| `messages.upsert` | New messages received |
|
|
401
|
+
| `messages.update` | Message status updates (read, delivered) |
|
|
402
|
+
| `message-receipt.update` | Read receipts |
|
|
403
|
+
| `groups.update` | Group metadata changes |
|
|
404
|
+
| `group-participants.update` | Group members added/removed/promoted |
|
|
405
|
+
| `call` | Incoming call events |
|
|
406
|
+
| `presence.update` | Contact presence (online, typing) |
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
## 🙏 Credits
|
|
411
|
+
|
|
412
|
+
- **Original Baileys** by [@WhiskeySockets](https://github.com/WhiskeySockets/Baileys)
|
|
413
|
+
- **libsignal** by [@signal](https://github.com/signalapp/libsignal-protocol-javascript)
|
|
414
|
+
- **All contributors** who made this project possible
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## ⚠️ Disclaimer
|
|
419
|
+
|
|
420
|
+
> This project is **not affiliated, associated, authorized, endorsed by, or in any way officially connected** with WhatsApp or any of its subsidiaries or affiliates.
|
|
421
|
+
>
|
|
422
|
+
> The official WhatsApp website can be found at [whatsapp.com](https://whatsapp.com). "WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners.
|
|
423
|
+
>
|
|
424
|
+
> **Use at your own discretion.** Do not spam people with this. We discourage any stalkerware, bulk or automated messaging usage.
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
<div align="center">
|
|
429
|
+
<p>Made with ❤️ by Fixo Dev.</p>
|
|
430
|
+
|
|
431
|
+
</div>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify --no-comments -o ./index.js ./WAProto.proto;
|
|
2
|
+
yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify ./WAProto.proto | yarn pbts --no-comments -o ./index.d.ts -;
|
|
3
|
+
node ./fix-imports.js
|