@zelynskybail/baileys 2.6.28 → 2.6.29
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 +119 -74
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,21 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/banner.svg" alt="ZelynskyBail" width="100%">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
Fork Baileys untuk bot WhatsApp yang capek tempel file builder manual ke setiap proyek.
|
|
7
|
+
</p>
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Package name:** `@zelynskybail/baileys`
|
|
9
|
+
<p align="center">
|
|
10
|
+
<code>v2.6.29</code> · Node.js 20+ · ESM · dikelola sendiri oleh Zell
|
|
11
|
+
</p>
|
|
9
12
|
|
|
10
|
-
>
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://www.npmjs.com/package/@zelynskybail/baileys">NPM</a> ·
|
|
15
|
+
<a href="https://github.com/zelynskybail/baileys">GitHub</a> ·
|
|
16
|
+
<a href="https://github.com/zelynskybail/baileys/issues">Lapor masalah</a>
|
|
17
|
+
</p>
|
|
11
18
|
|
|
12
|
-
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Kenapa ini ada
|
|
22
|
+
|
|
23
|
+
Setiap bikin bot, saya selalu mengulang hal yang sama: pasang Baileys, salin `MessageBuilder.js`, tambal sana-sini, lalu lupa file mana yang sudah diubah.
|
|
24
|
+
|
|
25
|
+
ZelynskyBail menggabungkan semuanya jadi satu paket. Builder pesan interaktif, pencarian pesan, penyimpanan kecil, sampai adapter panggilan suara, langsung bisa di-`import` tanpa file tambahan.
|
|
26
|
+
|
|
27
|
+
Saya pengembang yang masih belajar. Proyek ini saya rawat sendiri, tapi dibangun di atas kerja orang lain, dan itu tercatat jelas di bagian [Kredit](#kredit).
|
|
28
|
+
|
|
29
|
+
## Isi paket
|
|
30
|
+
|
|
31
|
+
| Bagian | Isinya |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Core | Socket, auth multi-device, Signal, WABinary/WAProto, grup, komunitas, newsletter, media |
|
|
34
|
+
| Builders | Button, ButtonV2/V3, NativeFlow, Carousel, AIRich, ORich, A2UI, Poll, Album, Contact, VCard, Location, LinkPreview, GroupStatusHelper |
|
|
35
|
+
| Message tools | Pencarian pesan, pengamat pesan dihapus, penyimpanan JSON atomik |
|
|
36
|
+
| Calls | `VoipClient` untuk panggilan suara keluar 1:1 |
|
|
37
|
+
|
|
38
|
+
## Pasang
|
|
39
|
+
|
|
40
|
+
<p align="center">
|
|
41
|
+
<img src="assets/terminal.svg" alt="npm install @zelynskybail/baileys" width="100%">
|
|
42
|
+
</p>
|
|
13
43
|
|
|
14
44
|
```bash
|
|
15
|
-
npm install @zelynskybail/baileys
|
|
45
|
+
npm install @zelynskybail/baileys pino
|
|
16
46
|
```
|
|
17
47
|
|
|
18
|
-
##
|
|
48
|
+
## Mulai cepat
|
|
19
49
|
|
|
20
50
|
```js
|
|
21
51
|
import makeWASocket, {
|
|
@@ -37,119 +67,112 @@ const sock = makeWASocket({
|
|
|
37
67
|
})
|
|
38
68
|
|
|
39
69
|
sock.ev.on('creds.update', saveCreds)
|
|
70
|
+
sock.ev.on('connection.update', ({ connection }) => console.log(connection))
|
|
40
71
|
```
|
|
41
72
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
### Core Baileys
|
|
73
|
+
Mau pakai nama `conn` bukan `sock`? Boleh. Itu cuma nama variabel, objeknya sama persis.
|
|
45
74
|
|
|
46
|
-
|
|
75
|
+
## Builder pesan
|
|
47
76
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
All builders ship inside this package; no project-local `MessageBuilder.js` file is required:
|
|
77
|
+
Semua builder bisa di-import langsung, atau dipanggil lewat socket:
|
|
51
78
|
|
|
52
79
|
```js
|
|
53
|
-
import {
|
|
54
|
-
Button, ButtonV2, ButtonV3, NativeFlow,
|
|
55
|
-
Carousel, AIRich, ORich, A2UIBuilder,
|
|
56
|
-
PollBuilder, AlbumBuilder, ContactBuilder, VCardBuilder,
|
|
57
|
-
LocationBuilder, LinkPreviewBuilder, GroupStatusHelper,
|
|
58
|
-
MessageBuilder
|
|
59
|
-
} from '@zelynskybail/baileys'
|
|
60
|
-
```
|
|
80
|
+
import { Button, Carousel, MessageBuilder } from '@zelynskybail/baileys'
|
|
61
81
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
const card = sock.createVCard().add({ name: 'Zell', phone: '+628123456789' })
|
|
83
|
+
await card.send('628123456789@s.whatsapp.net')
|
|
84
|
+
```
|
|
65
85
|
|
|
66
|
-
|
|
86
|
+
Pintasan di socket: `createButton`, `createButtonV2`, `createNativeFlow`, `createCarousel`, `createAIRich`, `createPoll`, `createAlbum`, `createContact`, `createVCard`, `createLocation`, `createLinkPreview`.
|
|
67
87
|
|
|
68
|
-
|
|
88
|
+
Status grup:
|
|
69
89
|
|
|
70
90
|
```js
|
|
71
|
-
import { GroupStatusHelper
|
|
72
|
-
|
|
73
|
-
await GroupStatusHelper.text(sock, '1203xxx@g.us', 'Hello group')
|
|
74
|
-
await GroupStatusHelper.image(sock, '1203xxx@g.us', './status.jpg', 'Group status')
|
|
91
|
+
import { GroupStatusHelper } from '@zelynskybail/baileys'
|
|
75
92
|
|
|
76
|
-
|
|
77
|
-
.add({ name: 'Zell', phone: '+628123456789' })
|
|
78
|
-
await card.send('628123456789@s.whatsapp.net')
|
|
93
|
+
await GroupStatusHelper.text(sock, '1203xxx@g.us', 'Halo grup!')
|
|
79
94
|
```
|
|
80
95
|
|
|
81
|
-
|
|
96
|
+
Tampilan status grup tergantung dukungan WhatsApp, jadi hasilnya bisa beda antar versi aplikasi.
|
|
82
97
|
|
|
83
|
-
|
|
98
|
+
## Cari pesan & pantau yang dihapus
|
|
84
99
|
|
|
85
100
|
```js
|
|
86
101
|
const search = await sock.createMessageSearch({ maxEntries: 5000 })
|
|
87
|
-
|
|
102
|
+
|
|
103
|
+
await sock.createAntiDeleteManager({
|
|
88
104
|
messageSearch: search,
|
|
89
|
-
onDelete: ({ key, message }) =>
|
|
90
|
-
console.log('Deleted message:', key, message)
|
|
91
|
-
}
|
|
105
|
+
onDelete: ({ key, message }) => console.log('Dihapus:', key, message)
|
|
92
106
|
}).start()
|
|
93
107
|
|
|
94
|
-
|
|
95
|
-
const matches = search.search('hello', { jid: '628xxxx@s.whatsapp.net', limit: 20 })
|
|
108
|
+
search.search('halo', { jid: '628xxxx@s.whatsapp.net', limit: 20 })
|
|
96
109
|
```
|
|
97
110
|
|
|
98
|
-
`
|
|
111
|
+
`AntiDeleteManager` hanya mengamati dan memanggil callback kamu. Ia tidak mengirim ulang pesan yang dihapus, itu urusan kodemu.
|
|
112
|
+
|
|
113
|
+
## Penyimpanan kecil
|
|
99
114
|
|
|
100
115
|
```js
|
|
101
116
|
import { PersistentStore } from '@zelynskybail/baileys'
|
|
117
|
+
|
|
102
118
|
const store = await new PersistentStore('./data/bot-store.json').open()
|
|
103
119
|
await store.set('mode', 'public')
|
|
104
120
|
console.log(store.get('mode'))
|
|
105
121
|
await store.close()
|
|
106
122
|
```
|
|
107
123
|
|
|
108
|
-
|
|
124
|
+
Tulisnya atomik, tapi ini untuk metadata kecil. Jangan dipakai sebagai database.
|
|
109
125
|
|
|
110
|
-
|
|
126
|
+
## Panggilan suara
|
|
111
127
|
|
|
112
128
|
```js
|
|
113
129
|
import { VoipClient } from '@zelynskybail/baileys'
|
|
114
130
|
|
|
115
131
|
const voip = new VoipClient({ authDir: './voip-session' })
|
|
116
132
|
await voip.connect()
|
|
133
|
+
|
|
117
134
|
const call = await voip.call('628123456789', {
|
|
118
135
|
audioSource: './audio.mp3',
|
|
119
136
|
durationMs: 30000
|
|
120
137
|
})
|
|
121
|
-
|
|
122
|
-
call.on('connected', () => console.log('
|
|
123
|
-
call.on('ended',
|
|
138
|
+
|
|
139
|
+
call.on('connected', () => console.log('Tersambung'))
|
|
140
|
+
call.on('ended', reason => console.log('Selesai:', reason))
|
|
124
141
|
```
|
|
125
142
|
|
|
126
|
-
|
|
143
|
+
Yang bisa: panggilan suara keluar 1:1, audio MP3/WAV dan PCM.
|
|
144
|
+
Yang belum: media RTC masuk, video call, panggilan grup.
|
|
145
|
+
`ffmpeg` hanya perlu kalau sumber audionya file.
|
|
127
146
|
|
|
128
|
-
|
|
147
|
+
Adapter ini memakai sesi linked-device terpisah dan tidak menyentuh socket utama.
|
|
129
148
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
149
|
+
## Profil performa
|
|
150
|
+
|
|
151
|
+
| Profil | Cocok untuk |
|
|
152
|
+
|---|---|
|
|
153
|
+
| `balanced` | Default, seimbang |
|
|
154
|
+
| `low-latency` | Respons secepat mungkin |
|
|
155
|
+
| `high-throughput` | Volume pesan besar |
|
|
156
|
+
| `low-memory` | VPS kecil |
|
|
133
157
|
|
|
134
|
-
|
|
158
|
+
Tiap profil menukar sesuatu (cache, history sync, retry, kualitas preview). Hasil nyata tergantung perangkat dan jaringanmu.
|
|
135
159
|
|
|
136
|
-
|
|
160
|
+
## Import per modul
|
|
137
161
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
162
|
+
```js
|
|
163
|
+
import { Button, Carousel } from '@zelynskybail/baileys/builders'
|
|
164
|
+
import { VoipClient } from '@zelynskybail/baileys/calls'
|
|
165
|
+
import { PersistentStore } from '@zelynskybail/baileys/utils/message-tools'
|
|
166
|
+
```
|
|
143
167
|
|
|
144
|
-
##
|
|
168
|
+
## Soal keamanan
|
|
145
169
|
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
- `@zelynskybail/baileys/utils/message-tools` — search, anti-delete observer and persistent store.
|
|
170
|
+
- Tidak ada auto-follow channel saat konek. Method newsletter tetap ada, tapi harus kamu panggil sendiri.
|
|
171
|
+
- Tidak ada script `preinstall`, `install`, atau `postinstall`.
|
|
172
|
+
- Dependensi gambar/video opsional dimuat saat dibutuhkan saja.
|
|
173
|
+
- Folder sesi berisi kredensial akun. Jangan pernah di-commit ke repo publik.
|
|
151
174
|
|
|
152
|
-
##
|
|
175
|
+
## Pengembangan
|
|
153
176
|
|
|
154
177
|
```bash
|
|
155
178
|
npm run verify
|
|
@@ -157,10 +180,32 @@ npm test
|
|
|
157
180
|
npm pack --dry-run
|
|
158
181
|
```
|
|
159
182
|
|
|
160
|
-
|
|
183
|
+
Lulus test belum berarti aman. Coba juga pairing, kirim/terima pesan, media, dan reconnect di akun WhatsApp uji.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Kredit
|
|
188
|
+
|
|
189
|
+
ZelynskyBail berdiri di atas kode orang lain. Saya mengelola dan menggabungkannya, bukan menulis semuanya dari nol.
|
|
190
|
+
|
|
191
|
+
| Siapa | Kontribusi |
|
|
192
|
+
|---|---|
|
|
193
|
+
| [WhiskeySockets/Baileys](https://github.com/WhiskeySockets/Baileys) | Fondasi socket dan protokol WhatsApp Web |
|
|
194
|
+
| Delkira Baileys | Salah satu sumber basis kode |
|
|
195
|
+
| Nixel | NIXCODE MessageBuilder 4.7 (Button, Carousel, AIRich, ORich, Toolkit). [WhatsApp](https://wa.me/6285188349341) · [Channel](https://whatsapp.com/channel/0029VbCV1ck8fewpdNb2TY2k) |
|
|
196
|
+
| Ahmad tumbuh kembang | Kontributor NIXCODE MessageBuilder 4.7 (sesuai watermark asli) |
|
|
197
|
+
| ShellTear | `baileys-caller`, dasar adapter VoIP |
|
|
198
|
+
|
|
199
|
+
Watermark dan pemberitahuan pembuat di NIXCODE MessageBuilder **tidak boleh dihapus**. Ketentuan redistribusinya ikut berlaku.
|
|
200
|
+
|
|
201
|
+
## Lisensi
|
|
202
|
+
|
|
203
|
+
Paket ini turunan dari beberapa sumber, dan lisensi tiap komponen tetap berlaku. Baca `LICENSE`, `NOTICE.md`, `THIRD_PARTY_NOTICES.md`, dan `THANKS.md` sebelum memakai, mengubah, atau menyebarkan ulang.
|
|
204
|
+
|
|
205
|
+
## Disclaimer
|
|
161
206
|
|
|
162
|
-
|
|
207
|
+
Proyek independen, tidak berafiliasi dengan WhatsApp atau Meta Platforms, Inc. WhatsApp bisa mengubah protokolnya kapan saja dan itu bisa merusak kompatibilitas. Pakai dengan bijak dan patuhi ketentuan layanan serta hukum yang berlaku.
|
|
163
208
|
|
|
164
|
-
|
|
209
|
+
---
|
|
165
210
|
|
|
166
|
-
|
|
211
|
+
Dirawat oleh Zell.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zelynskybail/baileys",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.6.
|
|
4
|
+
"version": "2.6.29",
|
|
5
5
|
"description": "Adaptive Baileys v7 fork with integrated interactive/rich-message builders, media/status utilities, message tools, and optional voice calling.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"main": "lib/index.js",
|