@neelegirl/baileys 2.1.4 → 2.1.5
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 +114 -37
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
### CJS-compatible WhatsApp Web API foundation for the Neelegirl ecosystem
|
|
6
6
|
|
|
7
|
-
[](https://www.npmjs.com/package/@neelegirl/baileys)
|
|
8
8
|
[](https://github.com/WhiskeySockets/Baileys)
|
|
9
9
|
[](https://nodejs.org)
|
|
10
10
|
[](LICENSE)
|
|
@@ -13,37 +13,42 @@
|
|
|
13
13
|
<img src="https://files.catbox.moe/phppor.JPG" width="760" alt="Neelegirl Baileys Header" />
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
-
|
|
|
16
|
+
| Paket | Version | Basis |
|
|
17
17
|
|---|---:|---|
|
|
18
|
-
| `@neelegirl/baileys` | `2.1.
|
|
18
|
+
| `@neelegirl/baileys` | `2.1.5` | `WhiskeySockets/Baileys v7.0.0-rc.9` |
|
|
19
19
|
|
|
20
|
-
[Installation](#installation) · [Quickstart](#quickstart) · [
|
|
20
|
+
[Installation](#installation) · [Quickstart](#quickstart) · [Funktionslogik](#funktionslogik) · [Aenderungen](#aenderungen--hinweise)
|
|
21
21
|
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Inhaltsverzeichnis
|
|
27
27
|
|
|
28
|
-
- [
|
|
28
|
+
- [Uebersicht](#uebersicht)
|
|
29
29
|
- [Installation](#installation)
|
|
30
30
|
- [Quickstart](#quickstart)
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
31
|
+
- [Funktionslogik](#funktionslogik)
|
|
32
|
+
- [Aenderungen und Hinweise](#aenderungen--hinweise)
|
|
33
|
+
- [libsignal im Stack](#libsignal-im-stack)
|
|
34
|
+
- [Word2Web Hinweise](#word2web-hinweise)
|
|
35
|
+
- [Kompatibilitaet und Grenzen](#kompatibilitaet-und-grenzen)
|
|
34
36
|
- [Changelog](#changelog)
|
|
35
37
|
- [Legal](#legal)
|
|
36
38
|
|
|
37
39
|
---
|
|
38
40
|
|
|
39
|
-
##
|
|
41
|
+
## Uebersicht
|
|
40
42
|
|
|
41
|
-
`@neelegirl/baileys`
|
|
43
|
+
`@neelegirl/baileys` ist die CJS-orientierte Laufzeitbasis fuer das Neelegirl-Setup. Es uebernimmt die Socket-, Event-, Auth- und Message-Mechanik und bleibt dabei kompatibel zu bestehenden `require()`-Projekten.
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
Wichtige Punkte aus den bisherigen Projekt-READMEs, auf den echten Code gemappt:
|
|
44
46
|
|
|
45
|
-
- QR-
|
|
46
|
-
- Message-ID
|
|
47
|
+
- QR-Flow bleibt wie im Projekt vorgesehen erhalten.
|
|
48
|
+
- Message-ID-Signatur mit `NEELE` bleibt erhalten.
|
|
49
|
+
- LID/JID-bezogene Verarbeitung ist in den Socket/Signal-Pfaden aktiv.
|
|
50
|
+
- npm-Update-Check ist enthalten (bei QR-Flow, nur einmal pro Prozess).
|
|
51
|
+
- Aktuelle lokale WA-Web-Version: `[2, 3000, 1035194821]`.
|
|
47
52
|
|
|
48
53
|
---
|
|
49
54
|
|
|
@@ -53,6 +58,22 @@ This fork explicitly keeps two project-critical customizations unchanged:
|
|
|
53
58
|
npm install @neelegirl/baileys
|
|
54
59
|
```
|
|
55
60
|
|
|
61
|
+
Import:
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
// CommonJS
|
|
65
|
+
const {
|
|
66
|
+
default: makeWASocket,
|
|
67
|
+
useMultiFileAuthState,
|
|
68
|
+
fetchLatestBaileysVersion,
|
|
69
|
+
DisconnectReason,
|
|
70
|
+
Browsers,
|
|
71
|
+
} = require('@neelegirl/baileys')
|
|
72
|
+
|
|
73
|
+
// ESM (namespace import auf CJS-Export)
|
|
74
|
+
import * as baileys from '@neelegirl/baileys'
|
|
75
|
+
```
|
|
76
|
+
|
|
56
77
|
---
|
|
57
78
|
|
|
58
79
|
## Quickstart
|
|
@@ -66,8 +87,8 @@ const {
|
|
|
66
87
|
Browsers,
|
|
67
88
|
} = require('@neelegirl/baileys')
|
|
68
89
|
|
|
69
|
-
async function
|
|
70
|
-
const { state, saveCreds } = await useMultiFileAuthState('./
|
|
90
|
+
async function startBot() {
|
|
91
|
+
const { state, saveCreds } = await useMultiFileAuthState('./auth_info')
|
|
71
92
|
const { version } = await fetchLatestBaileysVersion()
|
|
72
93
|
|
|
73
94
|
const sock = makeWASocket({
|
|
@@ -82,57 +103,113 @@ async function start() {
|
|
|
82
103
|
sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
|
|
83
104
|
if (connection === 'close') {
|
|
84
105
|
const code = lastDisconnect?.error?.output?.statusCode
|
|
85
|
-
if (code !== DisconnectReason.loggedOut)
|
|
106
|
+
if (code !== DisconnectReason.loggedOut) {
|
|
107
|
+
startBot()
|
|
108
|
+
}
|
|
109
|
+
return
|
|
86
110
|
}
|
|
87
111
|
|
|
88
112
|
if (connection === 'open') {
|
|
89
|
-
console.log('Connected')
|
|
113
|
+
console.log('Connected to WhatsApp')
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
sock.ev.on('messages.upsert', async ({ messages }) => {
|
|
118
|
+
const msg = messages?.[0]
|
|
119
|
+
const text = msg?.message?.conversation || msg?.message?.extendedTextMessage?.text || ''
|
|
120
|
+
const jid = msg?.key?.remoteJid
|
|
121
|
+
if (jid && text.toLowerCase() === 'ping') {
|
|
122
|
+
await sock.sendMessage(jid, { text: 'pong' })
|
|
90
123
|
}
|
|
91
124
|
})
|
|
92
125
|
}
|
|
93
126
|
|
|
94
|
-
|
|
127
|
+
startBot().catch(console.error)
|
|
95
128
|
```
|
|
96
129
|
|
|
97
130
|
---
|
|
98
131
|
|
|
99
|
-
##
|
|
132
|
+
## Funktionslogik
|
|
133
|
+
|
|
134
|
+
### Runtime und API
|
|
135
|
+
|
|
136
|
+
- Exporte aus `lib/index.js`:
|
|
137
|
+
- `default` / `makeWASocket`
|
|
138
|
+
- `Utils`, `Types`, `Store`, `Defaults`, `WABinary`, `WAM`, `WAUSync`, `WAProto`
|
|
139
|
+
- CJS-first Struktur (`main: lib/index.js`, `types: lib/index.d.ts`)
|
|
140
|
+
|
|
141
|
+
### Ereignisse und Verbindung
|
|
142
|
+
|
|
143
|
+
- `connection.update`, `messages.upsert`, `messages.update`, `creds.update`
|
|
144
|
+
- QR wird ueber den normalen Connection-Update-Flow ausgegeben
|
|
145
|
+
- Reconnect-Steuerung erfolgt ueber Disconnect-Grund (`DisconnectReason`)
|
|
146
|
+
|
|
147
|
+
### Auth und Session
|
|
148
|
+
|
|
149
|
+
- `useMultiFileAuthState` fuer persistente Session-Dateien
|
|
150
|
+
- Signale/Keys laufen ueber die integrierten Signal-Utilities
|
|
151
|
+
|
|
152
|
+
### Nachrichten und Hilfsfunktionen
|
|
153
|
+
|
|
154
|
+
- `sendMessage` fuer Text/Medien/reaktionen/polls usw.
|
|
155
|
+
- Gruppen-, Community-, Newsletter- und Store-Utilities sind enthalten
|
|
156
|
+
- LID/JID-Helfer (`jidDecode`, `jidEncode`, `isLidUser`) stehen ueber die Utility-Exports zur Verfuegung
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Aenderungen & Hinweise
|
|
100
161
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
162
|
+
Diese README uebernimmt die Dokumentationslogik aus den zwei Quell-READMEs und passt sie auf den realen Paketstand an:
|
|
163
|
+
|
|
164
|
+
- Funktionale Beschreibungen wurden beibehalten und auf echte Exporte reduziert.
|
|
165
|
+
- Historische Hinweise wurden bereinigt, wenn sie veraltete Versionen nannten.
|
|
166
|
+
- Keine nicht nachweisbaren Features aufgenommen.
|
|
167
|
+
|
|
168
|
+
Technisch relevante Punkte:
|
|
169
|
+
|
|
170
|
+
- QR-Logik unveraendert belassen.
|
|
171
|
+
- `NEELE`-Message-ID-Signatur unveraendert belassen.
|
|
172
|
+
- Update-Check auf npm-Registry aktiv.
|
|
173
|
+
- WA-Web-Version-Datei auf aktuellen lokalen Stand aktualisiert.
|
|
106
174
|
|
|
107
175
|
---
|
|
108
176
|
|
|
109
|
-
##
|
|
177
|
+
## libsignal im Stack
|
|
178
|
+
|
|
179
|
+
`@neelegirl/baileys` nutzt `@neelegirl/libsignal` fuer kryptografische Session-Bausteine (Identity, PreKeys, SessionState, Cipher-Operationen). Das ist die Grundlage fuer stabile Multi-Device-Kommunikation.
|
|
110
180
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Word2Web Hinweise
|
|
114
184
|
|
|
115
|
-
|
|
185
|
+
Es gibt in diesem Paket kein dediziertes Word2Web-Modul. Word2Web-spezifische Logik sollte nur dokumentiert/aktiviert werden, wenn sie in deiner Host-Anwendung wirklich implementiert ist.
|
|
116
186
|
|
|
117
187
|
---
|
|
118
188
|
|
|
119
|
-
##
|
|
189
|
+
## Kompatibilitaet und Grenzen
|
|
120
190
|
|
|
121
|
-
|
|
191
|
+
- Node.js: `>=20`
|
|
192
|
+
- CJS-fokussiert, nicht als 1:1-ESM-Upstream-Ersatz dokumentiert
|
|
193
|
+
- Die API ist auf bestehende Neelegirl-Consumer ausgerichtet
|
|
122
194
|
|
|
123
195
|
---
|
|
124
196
|
|
|
125
197
|
## Changelog
|
|
126
198
|
|
|
199
|
+
### 2.1.5
|
|
200
|
+
|
|
201
|
+
- README inhaltlich mit den Desktop-Quellen zusammengefuehrt (ohne blindes Kopieren)
|
|
202
|
+
- Funktionsbeschreibungen, Nutzungslogik und technische Hinweise auf realen Paketstand gemappt
|
|
203
|
+
- Versions- und Abhaengigkeitsabgleich im Neelegirl-Stack aktualisiert
|
|
204
|
+
- QR-Flow und `NEELE`-Message-ID-Verhalten unveraendert beibehalten
|
|
205
|
+
|
|
127
206
|
### 2.1.4
|
|
128
207
|
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
- Dependency alignment with `@neelegirl/libsignal@^1.0.8`
|
|
132
|
-
- Existing QR and `NEELE` message-ID custom logic preserved
|
|
208
|
+
- Style-/Layout-Refresh fuer konsistente Projektdokumentation
|
|
209
|
+
- Publish-Metadaten und CJS-Kompatibilitaet nachgezogen
|
|
133
210
|
|
|
134
211
|
---
|
|
135
212
|
|
|
136
213
|
## Legal
|
|
137
214
|
|
|
138
|
-
|
|
215
|
+
Dieses Projekt ist nicht mit WhatsApp verbunden. Nutzung nur in Uebereinstimmung mit geltendem Recht und Plattformregeln.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
{
|
|
2
2
|
"name": "@neelegirl/baileys",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"description": "CJS-compatible Baileys fork for Neelegirl projects, aligned with WhiskeySockets/Baileys 7.0.0-rc.9 and latest web version updates",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
43
43
|
"@cacheable/node-cache": "^1.5.4",
|
|
44
44
|
"@hapi/boom": "^9.1.3",
|
|
45
|
-
"@neelegirl/libsignal": "^1.0.
|
|
45
|
+
"@neelegirl/libsignal": "^1.0.9",
|
|
46
46
|
"async-mutex": "^0.5.0",
|
|
47
47
|
"audio-decode": "^2.1.3",
|
|
48
48
|
"axios": "^1.3.3",
|
|
@@ -107,4 +107,4 @@
|
|
|
107
107
|
"engines": {
|
|
108
108
|
"node": ">=20.0.0"
|
|
109
109
|
}
|
|
110
|
-
}
|
|
110
|
+
}
|