@deathnaitsa/wa-api 2.1.10 → 2.1.11

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.
@@ -0,0 +1 @@
1
+ {"noiseKey":{"private":{"type":"Buffer","data":"iCswVtVpbw7rL+MVBSX//yW4wDfD3W0MSM9CJd2dZlQ="},"public":{"type":"Buffer","data":"qgFSjsAGh4BUk1oReWHuCsBe/S8dg+U9YZZq8/j5Z1E="}},"pairingEphemeralKeyPair":{"private":{"type":"Buffer","data":"iBzG8Wt1ahHk0pLG/W6pq/VZ+6Cy0HV5TnFI/WMS2mo="},"public":{"type":"Buffer","data":"aet23YL7Oz/LQHkmmGl6ltkgoa0b/7eAkmqi7cMHzkU="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"eL0rLIMtdfCv9NciJxHnlN3xp/4KOQgk6Wvpqvavv3A="},"public":{"type":"Buffer","data":"XbGl8AHm4WxcusTq2dSmgCzZ5WzaVnsiZzV0yyfVqnw="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"UBnneaFGv7P4cWELZlo9WgoJXRIPSC5kgKPaTWLUKFM="},"public":{"type":"Buffer","data":"sgqyZUCXrZ4KIq9fS9MGoHi0A9x4rKwa7XvTNYOhfS4="}},"signature":{"type":"Buffer","data":"6FGGmDXavpcuKYp10sD/7VKYyhEDbT5Leh/vqCKCXjOLceuk7fv/EX7IzkErfFsf3MuxkCDNfMEwF71EZNaIDQ=="},"keyId":1},"registrationId":48,"advSecretKey":"8JKVJeuYbPMEL1uGsn36DkmT71nMAlC0KLL9Z2RwQaw=","processedHistoryMessages":[],"nextPreKeyId":1,"firstUnuploadedPreKeyId":1,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"registered":true,"pairingCode":"8D88S3LK","me":{"id":"436505985269@s.whatsapp.net","name":"~"}}
package/README.md CHANGED
@@ -175,21 +175,30 @@ import {
175
175
  await startSession('bot1');
176
176
 
177
177
  // Session mit Pairing Code (Alternative zu QR-Code)
178
- const { code } = await startSessionWithPairingCode('bot1', '491234567890');
179
- console.log('Gib diesen Code in WhatsApp ein:', code);
180
- // Telefonnummer ohne +, z.B. "491234567890" statt "+49 123 456 7890"
178
+ // Telefonnummer immer ohne +, Leerzeichen oder Bindestriche, z.B. "49834732387"
179
+ const { code } = await startSessionWithPairingCode('bot1', '49834732387', {
180
+ printQR: false,
181
+ markOnlineOnConnect: false
182
+ });
183
+ console.log('Gib diesen Code in WhatsApp unter "Verknüpfte Geräte" ein:', code);
181
184
 
182
185
  // Optional: eigenen 8-stelligen Pairing Code vorgeben
183
- const { code: customCode } = await startSessionWithPairingCode('bot2', '491234567890', {
184
- pairingCode: 'ABCD1234'
186
+ const { code: customCode } = await startSessionWithPairingCode('bot2', '49834732387', {
187
+ pairingCode: 'ABCD1234',
188
+ printQR: false,
189
+ markOnlineOnConnect: false
185
190
  });
186
- console.log('Verwendeter eigener Pairing Code:', customCode);
191
+ console.log('Verwendeter eigener Pairing Code:', customCode); // => ABCD1234
187
192
 
188
193
  // Session mit SQLite Auth (empfohlen für Production!)
189
194
  await startSession('bot1', { sql: true });
190
195
 
191
196
  // Pairing Code mit SQLite
192
- await startSessionWithPairingCode('bot1', '491234567890', { sql: true });
197
+ await startSessionWithPairingCode('bot1', '49834732387', {
198
+ sql: true,
199
+ printQR: false,
200
+ markOnlineOnConnect: false
201
+ });
193
202
 
194
203
  // Weitere Optionen
195
204
  await startSession('bot1', {
@@ -546,11 +555,11 @@ onQRUpdate(({ sessionId, qr }) => {
546
555
  onPairingCode(({ sessionId, phoneNumber, code }) => {
547
556
  console.log(`🔐 Pairing Code für ${sessionId} (${phoneNumber}): ${code}`);
548
557
 
549
- // Beispiele für die Verwendung:
550
- // 1. Code an Frontend/User anzeigen
551
- // 2. Per SMS/Email versenden
552
- // 3. In Datenbank speichern
553
- // 4. Per WebSocket an Client schicken
558
+ // Präziser Ablauf:
559
+ // 1. Code sofort im Frontend oder Terminal anzeigen
560
+ // 2. User öffnet WhatsApp -> Verknüpfte Geräte -> Gerät hinzufügen
561
+ // 3. User gibt den 8-stelligen Code ein
562
+ // 4. Nach erfolgreicher Verknüpfung kommt das `connected`-Event
554
563
  });
555
564
 
556
565
  // Weitere Events über Client: