@yudzxml/baileys 7.3.3 → 7.3.4
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 +3 -3
- package/lib/Socket/messages-recv.js +145 -49
- package/package.json +16 -6
package/README.md
CHANGED
|
@@ -77,8 +77,8 @@ import makeWASocket from '@yudzxml/baileys'
|
|
|
77
77
|
|
|
78
78
|
## 📚 Documentation
|
|
79
79
|
|
|
80
|
-
- **[Official
|
|
81
|
-
- **[
|
|
80
|
+
- **[Official Channel](https://whatsapp.com/channel/0029Vb7rkVo5q08hZXxxrY3v)**
|
|
81
|
+
- **[Group Community](https://chat.whatsapp.com/B9v9lXijkfPKr4QmAQgApu?mode=gi_t)**
|
|
82
82
|
|
|
83
83
|
---
|
|
84
84
|
|
|
@@ -397,4 +397,4 @@ MIT - Copyright (c) 2026 Yudzxml
|
|
|
397
397
|
|
|
398
398
|
<div align="center">
|
|
399
399
|
Made with ❤️ by Yudzxml
|
|
400
|
-
</div>
|
|
400
|
+
</div>
|
|
@@ -683,66 +683,162 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
683
683
|
}
|
|
684
684
|
|
|
685
685
|
const handleMexNotification = (id, node) => {
|
|
686
|
+
try {
|
|
686
687
|
const operation = node?.attrs?.op_name
|
|
687
|
-
|
|
688
|
-
|
|
688
|
+
if (!operation) return
|
|
689
|
+
|
|
690
|
+
// Safe JSON parse
|
|
691
|
+
let content = {}
|
|
692
|
+
try {
|
|
693
|
+
content = typeof node?.content === 'string'
|
|
694
|
+
? JSON.parse(node.content)
|
|
695
|
+
: node?.content || {}
|
|
696
|
+
} catch (err) {
|
|
697
|
+
logger?.warn?.(
|
|
698
|
+
{ err, node },
|
|
699
|
+
'Failed to parse mex content'
|
|
700
|
+
)
|
|
701
|
+
return
|
|
702
|
+
}
|
|
703
|
+
|
|
689
704
|
let contentPath
|
|
690
705
|
let action
|
|
691
|
-
|
|
706
|
+
|
|
707
|
+
// Newsletter settings update
|
|
692
708
|
if (operation === MexOperations.UPDATE) {
|
|
693
|
-
|
|
694
|
-
|
|
709
|
+
contentPath =
|
|
710
|
+
content?.data?.[XWAPaths.METADATA_UPDATE]
|
|
711
|
+
|
|
712
|
+
if (!contentPath?.thread_metadata?.settings) return
|
|
713
|
+
|
|
695
714
|
ev.emit('newsletter-settings.update', {
|
|
696
|
-
|
|
715
|
+
id,
|
|
697
716
|
update: contentPath.thread_metadata.settings
|
|
698
|
-
})
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
717
|
+
})
|
|
718
|
+
|
|
719
|
+
return
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// Group member link mode
|
|
723
|
+
if (operation === MexUpdatesOperations.GROUP_MEMBER_LINK) {
|
|
724
|
+
contentPath =
|
|
725
|
+
content?.data?.[
|
|
726
|
+
XWAPathsMexUpdates.GROUP_SHARING_CHANGE
|
|
727
|
+
]
|
|
728
|
+
|
|
729
|
+
if (!contentPath?.properties) return
|
|
730
|
+
|
|
731
|
+
ev.emit('groups.update', [{
|
|
732
|
+
id,
|
|
733
|
+
author: contentPath?.updated_by?.id,
|
|
734
|
+
member_link_mode:
|
|
735
|
+
contentPath?.properties?.member_link_mode
|
|
736
|
+
}])
|
|
737
|
+
|
|
738
|
+
return
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// Group limit sharing
|
|
742
|
+
if (operation === MexUpdatesOperations.GROUP_LIMIT_SHARING) {
|
|
743
|
+
contentPath =
|
|
744
|
+
content?.data?.[
|
|
745
|
+
XWAPathsMexUpdates.GROUP_SHARING_CHANGE
|
|
746
|
+
]
|
|
747
|
+
|
|
748
|
+
const limitSharing =
|
|
749
|
+
contentPath?.properties?.limit_sharing
|
|
750
|
+
|
|
751
|
+
if (!limitSharing) return
|
|
752
|
+
|
|
710
753
|
ev.emit('limit-sharing.update', {
|
|
711
|
-
|
|
712
|
-
author:
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
754
|
+
id,
|
|
755
|
+
author:
|
|
756
|
+
contentPath?.updated_by?.pn ||
|
|
757
|
+
contentPath?.updated_by?.id,
|
|
758
|
+
action:
|
|
759
|
+
limitSharing?.limit_sharing_enabled
|
|
760
|
+
? 'on'
|
|
761
|
+
: 'off',
|
|
762
|
+
trigger:
|
|
763
|
+
limitSharing?.limit_sharing_trigger,
|
|
764
|
+
update_time:
|
|
765
|
+
contentPath?.update_time
|
|
766
|
+
})
|
|
767
|
+
|
|
768
|
+
return
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
// Community owner update
|
|
772
|
+
if (operation === MexUpdatesOperations.OWNER_COMMUNITY) {
|
|
773
|
+
contentPath =
|
|
774
|
+
content?.data?.[
|
|
775
|
+
XWAPathsMexUpdates.COMMUNITY_OWNER_CHANGE
|
|
776
|
+
]
|
|
777
|
+
|
|
778
|
+
const roleUpdate =
|
|
779
|
+
contentPath?.role_updates?.[0]
|
|
780
|
+
|
|
781
|
+
if (!roleUpdate) return
|
|
782
|
+
|
|
720
783
|
ev.emit('community-owner.update', {
|
|
721
|
-
|
|
722
|
-
author:
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
784
|
+
id,
|
|
785
|
+
author:
|
|
786
|
+
contentPath?.updated_by?.pn ||
|
|
787
|
+
contentPath?.updated_by?.id,
|
|
788
|
+
user:
|
|
789
|
+
roleUpdate?.user?.pn ||
|
|
790
|
+
roleUpdate?.user?.jid,
|
|
791
|
+
new_role:
|
|
792
|
+
roleUpdate?.new_role,
|
|
793
|
+
update_time:
|
|
794
|
+
contentPath?.update_time
|
|
795
|
+
})
|
|
796
|
+
|
|
797
|
+
return
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// Promote / Demote fallback
|
|
801
|
+
if (operation === MexOperations.PROMOTE) {
|
|
802
|
+
action = 'promote'
|
|
803
|
+
contentPath =
|
|
804
|
+
content?.data?.[XWAPaths.PROMOTE]
|
|
805
|
+
} else if (operation === MexOperations.DEMOTE) {
|
|
806
|
+
action = 'demote'
|
|
807
|
+
contentPath =
|
|
808
|
+
content?.data?.[XWAPaths.DEMOTE]
|
|
727
809
|
} else {
|
|
728
|
-
|
|
729
|
-
if (operation === MexOperations.PROMOTE) {
|
|
730
|
-
action = 'promote'
|
|
731
|
-
contentPath = content.data[XWAPaths.PROMOTE]
|
|
732
|
-
} else {
|
|
733
|
-
action = 'demote'
|
|
734
|
-
contentPath = content.data[XWAPaths.DEMOTE]
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
ev.emit('newsletter-participants.update', {
|
|
738
|
-
id,
|
|
739
|
-
author: contentPath.actor.pn,
|
|
740
|
-
user: contentPath.user.pn,
|
|
741
|
-
new_role: contentPath.user_new_role,
|
|
742
|
-
action
|
|
743
|
-
})
|
|
810
|
+
return
|
|
744
811
|
}
|
|
812
|
+
|
|
813
|
+
if (!contentPath?.actor || !contentPath?.user) {
|
|
814
|
+
logger?.debug?.(
|
|
815
|
+
{ operation, content },
|
|
816
|
+
'Missing promote/demote contentPath'
|
|
817
|
+
)
|
|
818
|
+
return
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
ev.emit('newsletter-participants.update', {
|
|
822
|
+
id,
|
|
823
|
+
author:
|
|
824
|
+
contentPath?.actor?.pn ||
|
|
825
|
+
contentPath?.actor?.id,
|
|
826
|
+
user:
|
|
827
|
+
contentPath?.user?.pn ||
|
|
828
|
+
contentPath?.user?.id,
|
|
829
|
+
new_role:
|
|
830
|
+
contentPath?.user_new_role,
|
|
831
|
+
action
|
|
832
|
+
})
|
|
833
|
+
|
|
834
|
+
} catch (err) {
|
|
835
|
+
// Jangan bikin baileys mati
|
|
836
|
+
logger?.error?.(
|
|
837
|
+
{ err, node, id },
|
|
838
|
+
'handleMexNotification crashed'
|
|
839
|
+
)
|
|
745
840
|
}
|
|
841
|
+
}
|
|
746
842
|
|
|
747
843
|
const processNotification = async (node) => {
|
|
748
844
|
const result = {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yudzxml/baileys",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.4",
|
|
4
4
|
"description": "WhatsApp API Modification By Yudzxml",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
@@ -12,25 +12,28 @@
|
|
|
12
12
|
"automation",
|
|
13
13
|
"multi-device"
|
|
14
14
|
],
|
|
15
|
+
|
|
15
16
|
"homepage": "https://github.com/Yudzxml/Baileys",
|
|
17
|
+
|
|
16
18
|
"bugs": {
|
|
17
|
-
|
|
19
|
+
"url": "https://github.com/Yudzxml/Baileys/issues"
|
|
18
20
|
},
|
|
21
|
+
|
|
19
22
|
"repository": {
|
|
20
23
|
"type": "git",
|
|
21
24
|
"url": "https://github.com/Yudzxml/Baileys.git"
|
|
22
25
|
},
|
|
23
|
-
|
|
24
|
-
"registry": "https://registry.npmjs.org"
|
|
25
|
-
},
|
|
26
|
+
|
|
26
27
|
"license": "MIT",
|
|
27
28
|
"author": "Yudzxml",
|
|
29
|
+
|
|
28
30
|
"main": "lib/index.js",
|
|
29
31
|
"files": [
|
|
30
32
|
"lib/*",
|
|
31
33
|
"WAProto/*",
|
|
32
34
|
"engine-requirements.js"
|
|
33
35
|
],
|
|
36
|
+
|
|
34
37
|
"scripts": {
|
|
35
38
|
"changelog:last": "conventional-changelog -p angular -r 2",
|
|
36
39
|
"changelog:preview": "conventional-changelog -p angular -u",
|
|
@@ -41,6 +44,7 @@
|
|
|
41
44
|
"release": "release-it",
|
|
42
45
|
"test": "jest"
|
|
43
46
|
},
|
|
47
|
+
|
|
44
48
|
"dependencies": {
|
|
45
49
|
"@hapi/boom": "^9.1.3",
|
|
46
50
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
@@ -60,6 +64,7 @@
|
|
|
60
64
|
"qrcode-terminal": "^0.12.0",
|
|
61
65
|
"ws": "^8.13.0"
|
|
62
66
|
},
|
|
67
|
+
|
|
63
68
|
"devDependencies": {
|
|
64
69
|
"@types/jest": "^29.5.14",
|
|
65
70
|
"@types/node": "^16.0.0",
|
|
@@ -79,19 +84,24 @@
|
|
|
79
84
|
"typedoc-plugin-markdown": "4.4.2",
|
|
80
85
|
"typescript": "^5.8.2"
|
|
81
86
|
},
|
|
87
|
+
|
|
82
88
|
"peerDependencies": {
|
|
83
|
-
"jimp": "^0.22.12",
|
|
89
|
+
"jimp": "^0.22.12",
|
|
84
90
|
"sharp": "*"
|
|
85
91
|
},
|
|
92
|
+
|
|
86
93
|
"peerDependenciesMeta": {
|
|
87
94
|
"jimp": {
|
|
88
95
|
"optional": true
|
|
89
96
|
}
|
|
90
97
|
},
|
|
98
|
+
|
|
91
99
|
"packageManager": "yarn@1.22.19",
|
|
100
|
+
|
|
92
101
|
"engines": {
|
|
93
102
|
"node": ">=20.0.0"
|
|
94
103
|
},
|
|
104
|
+
|
|
95
105
|
"directories": {
|
|
96
106
|
"lib": "lib"
|
|
97
107
|
}
|