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 +8 -1
- package/src/client.js +81 -0
- package/src/console-logger.js +1 -1
- package/src/message.js +64 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "waengine",
|
|
3
|
-
"version": "1.8.
|
|
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 =====
|
package/src/console-logger.js
CHANGED
|
@@ -13,7 +13,7 @@ export class ConsoleLogger {
|
|
|
13
13
|
|
|
14
14
|
console.log(`
|
|
15
15
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
16
|
-
β π WAEngine v1.8.
|
|
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
|
-
//
|
|
1562
|
-
|
|
1563
|
-
if (
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
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
|
-
|
|
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;
|