@zetagoaurum-socket/wasocket 2.1.5 → 2.1.7
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/lib/Socket/messages-send.js +11 -17
- package/package.json +1 -1
|
@@ -312,10 +312,9 @@ const makeMessagesSocket = (config) => {
|
|
|
312
312
|
const devices = [];
|
|
313
313
|
const meMsg = {
|
|
314
314
|
deviceSentMessage: {
|
|
315
|
+
destinationJid,
|
|
315
316
|
destinationJid,
|
|
316
317
|
message,
|
|
317
|
-
phash: '2:1:a', // Fake enterprise phash
|
|
318
|
-
metaVerified: true // Fake Meta Verified attribute
|
|
319
318
|
}
|
|
320
319
|
};
|
|
321
320
|
const extraAttrs = {}
|
|
@@ -547,7 +546,7 @@ const makeMessagesSocket = (config) => {
|
|
|
547
546
|
logger.debug({ jid }, 'adding device identity');
|
|
548
547
|
}
|
|
549
548
|
|
|
550
|
-
if (AI
|
|
549
|
+
if (AI) {
|
|
551
550
|
const botNode = {
|
|
552
551
|
tag: 'bot',
|
|
553
552
|
attrs: {
|
|
@@ -585,13 +584,7 @@ const makeMessagesSocket = (config) => {
|
|
|
585
584
|
stanza.content.push(...additionalNodes);
|
|
586
585
|
}
|
|
587
586
|
|
|
588
|
-
|
|
589
|
-
if (!stanza.content.find(c => c.tag === 'bot')) {
|
|
590
|
-
stanza.content.push({
|
|
591
|
-
tag: 'bot',
|
|
592
|
-
attrs: { biz_bot: '1' }
|
|
593
|
-
});
|
|
594
|
-
}
|
|
587
|
+
|
|
595
588
|
|
|
596
589
|
logger.debug({ msgId }, `sending message to ${participants.length} devices`);
|
|
597
590
|
await sendNode(stanza);
|
|
@@ -828,7 +821,8 @@ const makeMessagesSocket = (config) => {
|
|
|
828
821
|
const paymentContent = await rahmi.handlePayment(content, quoted);
|
|
829
822
|
return await relayMessage(jid, paymentContent, {
|
|
830
823
|
messageId: Utils_1.generateMessageID(),
|
|
831
|
-
...getParticipantAttr()
|
|
824
|
+
...getParticipantAttr(),
|
|
825
|
+
AI: true
|
|
832
826
|
});
|
|
833
827
|
|
|
834
828
|
case 'PRODUCT':
|
|
@@ -836,7 +830,8 @@ const makeMessagesSocket = (config) => {
|
|
|
836
830
|
const productMsg = await Utils_1.generateWAMessageFromContent(jid, productContent, { quoted });
|
|
837
831
|
return await relayMessage(jid, productMsg.message, {
|
|
838
832
|
messageId: productMsg.key.id,
|
|
839
|
-
...getParticipantAttr()
|
|
833
|
+
...getParticipantAttr(),
|
|
834
|
+
AI: true
|
|
840
835
|
});
|
|
841
836
|
|
|
842
837
|
case 'INTERACTIVE':
|
|
@@ -844,7 +839,8 @@ const makeMessagesSocket = (config) => {
|
|
|
844
839
|
const interactiveMsg = await Utils_1.generateWAMessageFromContent(jid, interactiveContent, { quoted });
|
|
845
840
|
return await relayMessage(jid, interactiveMsg.message, {
|
|
846
841
|
messageId: interactiveMsg.key.id,
|
|
847
|
-
...getParticipantAttr()
|
|
842
|
+
...getParticipantAttr(),
|
|
843
|
+
AI: true
|
|
848
844
|
});
|
|
849
845
|
case 'ALBUM':
|
|
850
846
|
return await rahmi.handleAlbum(content, jid, quoted)
|
|
@@ -881,14 +877,12 @@ const makeMessagesSocket = (config) => {
|
|
|
881
877
|
...options
|
|
882
878
|
});
|
|
883
879
|
|
|
884
|
-
|
|
885
|
-
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
886
|
-
await delay(Math.floor(Math.random() * 1000) + 500);
|
|
880
|
+
|
|
887
881
|
|
|
888
882
|
const isDeleteMsg = 'delete' in content && !!content.delete;
|
|
889
883
|
const isEditMsg = 'edit' in content && !!content.edit;
|
|
890
884
|
// FORCE AI BADGES FOR ALL MESSAGES
|
|
891
|
-
const isAiMsg =
|
|
885
|
+
const isAiMsg = 'ai' in content && !!content.ai;
|
|
892
886
|
|
|
893
887
|
const additionalAttributes = {};
|
|
894
888
|
const additionalNodes = [];
|