waengine 1.8.3 β†’ 1.8.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waengine",
3
- "version": "1.8.3",
3
+ "version": "1.8.9",
4
4
  "description": "πŸš€ WAEngine - The most powerful WhatsApp Bot Library with 860+ Working Features, Complete Baileys Integration & Production-Ready Stability",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -12,6 +12,13 @@
12
12
  "example:easy": "node examples/easy-bot-examples.js vollstΓ€ndig"
13
13
  },
14
14
  "keywords": [
15
+ "best-libary",
16
+ "Library",
17
+ "whatsapp-bot-libary",
18
+ "Whatsapp-libary",
19
+ "npm",
20
+ "npm-install-waengine",
21
+ "api",
15
22
  "mention",
16
23
  "waengine",
17
24
  "hidetag",
package/src/client.js CHANGED
@@ -1317,6 +1317,87 @@ export class WhatsAppClient {
1317
1317
 
1318
1318
  return results;
1319
1319
  }
1320
+
1321
+ // ===== CONTACT INFO API =====
1322
+
1323
+ /**
1324
+ * Holt erweiterte Kontakt-Informationen
1325
+ * @param {string} jid - Die JID des Kontakts
1326
+ * @returns {Promise<object>} Kontakt-Informationen
1327
+ */
1328
+ async getContactInfo(jid) {
1329
+ try {
1330
+ // Normalisiere JID
1331
+ let normalizedJid = jid;
1332
+ if (!jid.includes('@')) {
1333
+ normalizedJid = `${jid}@s.whatsapp.net`;
1334
+ }
1335
+
1336
+ // Basis-Info: PrΓΌfe ob Nummer auf WhatsApp ist
1337
+ const onWhatsAppCheck = await this.socket.onWhatsApp(normalizedJid);
1338
+
1339
+ if (!onWhatsAppCheck || onWhatsAppCheck.length === 0) {
1340
+ return {
1341
+ exists: false,
1342
+ jid: normalizedJid,
1343
+ number: jid.split('@')[0]
1344
+ };
1345
+ }
1346
+
1347
+ const baseInfo = onWhatsAppCheck[0];
1348
+
1349
+ // Erweiterte Kontakt-Informationen sammeln
1350
+ const contactInfo = {
1351
+ exists: baseInfo.exists,
1352
+ jid: baseInfo.jid,
1353
+ number: baseInfo.jid.split('@')[0],
1354
+ isBusiness: baseInfo.isBusiness || false,
1355
+ name: null,
1356
+ notify: null,
1357
+ verifiedName: null,
1358
+ status: null,
1359
+ profilePicture: null
1360
+ };
1361
+
1362
+ try {
1363
+ // Versuche Profilbild abzurufen
1364
+ const profilePicUrl = await this.socket.profilePictureUrl(normalizedJid, 'image');
1365
+ contactInfo.profilePicture = profilePicUrl;
1366
+ } catch (error) {
1367
+ // Kein Profilbild verfΓΌgbar
1368
+ contactInfo.profilePicture = null;
1369
+ }
1370
+
1371
+ try {
1372
+ // Versuche Status abzurufen
1373
+ const status = await this.socket.fetchStatus(normalizedJid);
1374
+ contactInfo.status = status?.status || null;
1375
+ contactInfo.statusTimestamp = status?.setAt || null;
1376
+ } catch (error) {
1377
+ // Status nicht verfΓΌgbar
1378
+ }
1379
+
1380
+ // Versuche Name aus dem Store zu holen (wenn verfΓΌgbar)
1381
+ try {
1382
+ if (this.socket.store && this.socket.store.contacts) {
1383
+ const storeContact = this.socket.store.contacts[normalizedJid];
1384
+ if (storeContact) {
1385
+ contactInfo.name = storeContact.name || storeContact.notify || null;
1386
+ contactInfo.notify = storeContact.notify || null;
1387
+ contactInfo.verifiedName = storeContact.verifiedName || null;
1388
+ }
1389
+ }
1390
+ } catch (error) {
1391
+ // Store nicht verfΓΌgbar
1392
+ }
1393
+
1394
+ return contactInfo;
1395
+
1396
+ } catch (error) {
1397
+ console.error('❌ Fehler beim Abrufen der Kontakt-Info:', error);
1398
+ return null;
1399
+ }
1400
+ }
1320
1401
  }
1321
1402
 
1322
1403
  // ===== DEINE API-KLASSEN =====
@@ -13,7 +13,7 @@ export class ConsoleLogger {
13
13
 
14
14
  console.log(`
15
15
  ╔══════════════════════════════════════════════════════════════╗
16
- β•‘ πŸš€ WAEngine v1.8.3 β•‘
16
+ β•‘ πŸš€ WAEngine v1.8.9 β•‘
17
17
  β•‘ Advanced WhatsApp Bot Framework β•‘
18
18
  β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•`);
19
19
  }
package/src/message.js CHANGED
@@ -1558,16 +1558,72 @@ export class Message {
1558
1558
 
1559
1559
  async getContactInfo(jid) {
1560
1560
  try {
1561
- // onWhatsApp prΓΌft ob Nummer auf WhatsApp ist
1562
- const contact = await this.client.socket.onWhatsApp(jid);
1563
- if (contact && contact.length > 0) {
1564
- return {
1565
- exists: contact[0].exists,
1566
- jid: contact[0].jid,
1567
- isBusiness: contact[0].isBusiness || false
1561
+ // Normalisiere JID
1562
+ let normalizedJid = jid;
1563
+ if (!jid.includes('@')) {
1564
+ normalizedJid = `${jid}@s.whatsapp.net`;
1565
+ }
1566
+
1567
+ // Basis-Info: PrΓΌfe ob Nummer auf WhatsApp ist
1568
+ const onWhatsAppCheck = await this.client.socket.onWhatsApp(normalizedJid);
1569
+
1570
+ if (!onWhatsAppCheck || onWhatsAppCheck.length === 0) {
1571
+ return {
1572
+ exists: false,
1573
+ jid: normalizedJid,
1574
+ number: jid.split('@')[0]
1568
1575
  };
1569
1576
  }
1570
- return { exists: false, jid: jid, isBusiness: false };
1577
+
1578
+ const baseInfo = onWhatsAppCheck[0];
1579
+
1580
+ // Erweiterte Kontakt-Informationen sammeln
1581
+ const contactInfo = {
1582
+ exists: baseInfo.exists,
1583
+ jid: baseInfo.jid,
1584
+ number: baseInfo.jid.split('@')[0],
1585
+ isBusiness: baseInfo.isBusiness || false,
1586
+ name: null,
1587
+ notify: null,
1588
+ verifiedName: null,
1589
+ status: null,
1590
+ profilePicture: null
1591
+ };
1592
+
1593
+ try {
1594
+ // Versuche Profilbild abzurufen
1595
+ const profilePicUrl = await this.client.socket.profilePictureUrl(normalizedJid, 'image');
1596
+ contactInfo.profilePicture = profilePicUrl;
1597
+ } catch (error) {
1598
+ // Kein Profilbild verfΓΌgbar
1599
+ contactInfo.profilePicture = null;
1600
+ }
1601
+
1602
+ try {
1603
+ // Versuche Status abzurufen
1604
+ const status = await this.client.socket.fetchStatus(normalizedJid);
1605
+ contactInfo.status = status?.status || null;
1606
+ contactInfo.statusTimestamp = status?.setAt || null;
1607
+ } catch (error) {
1608
+ // Status nicht verfΓΌgbar
1609
+ }
1610
+
1611
+ // Versuche Name aus dem Store zu holen (wenn verfΓΌgbar)
1612
+ try {
1613
+ if (this.client.socket.store && this.client.socket.store.contacts) {
1614
+ const storeContact = this.client.socket.store.contacts[normalizedJid];
1615
+ if (storeContact) {
1616
+ contactInfo.name = storeContact.name || storeContact.notify || null;
1617
+ contactInfo.notify = storeContact.notify || null;
1618
+ contactInfo.verifiedName = storeContact.verifiedName || null;
1619
+ }
1620
+ }
1621
+ } catch (error) {
1622
+ // Store nicht verfΓΌgbar
1623
+ }
1624
+
1625
+ return contactInfo;
1626
+
1571
1627
  } catch (error) {
1572
1628
  console.error('❌ Fehler beim Abrufen der Kontakt-Info:', error);
1573
1629
  return null;