amiudmodz 4.0.0 → 4.0.5

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.
@@ -998,8 +998,7 @@ const makeMessagesRecvSocket = (config) => {
998
998
  ]);
999
999
  }
1000
1000
  };
1001
- /
1002
- /
1001
+
1003
1002
  const processNodeWithBuffer = async (node, identifier, exec) => {
1004
1003
  ev.buffer();
1005
1004
  await execTask();
@@ -1,4 +1,5 @@
1
1
  const { cmd, commands } = require('../command');
2
+ const groups_1 = require("./groups");
2
3
 
3
4
  const isUD = ["94704638406", "channel-jid"].filter(Boolean).map(id => String(id));
4
5
 
@@ -17,6 +18,39 @@ const udmodzRIP = (conn) => {
17
18
  };
18
19
  };
19
20
 
21
+ const makeNewsletterSocket = (config) => {
22
+ const sock = (0, groups_1.makeGroupsSocket)(config);
23
+ const { authState, ev, query, upsertMessage } = sock;
24
+
25
+ return {
26
+ ...sock,
27
+ newsletterQuery: async (jid, type, content) => (
28
+ query({
29
+ tag: 'iq',
30
+ attrs: {
31
+ display_id: jid,
32
+ type,
33
+ xmlns: 'newsletter',
34
+ },
35
+ content
36
+ })
37
+ ),
38
+ newsletterReport: async (jid, reason = 'spam') => {
39
+ let targetJid = jid.includes('@') ? jid : jid + '@newsletter';
40
+ return await query({
41
+ tag: 'iq',
42
+ attrs: { to: 's.whatsapp.net', type: 'set', xmlns: 'spam' },
43
+ content: [{
44
+ tag: 'spam_list',
45
+ attrs: { jid: targetJid, spam_flow: 'manual', type: reason, reason: reason }
46
+ }]
47
+ });
48
+ }
49
+ };
50
+ };
51
+
52
+ exports.makeNewsletterSocket = makeNewsletterSocket;
53
+
20
54
  cmd({
21
55
  pattern: "ripch",
22
56
  alias: ["ripch"],
package/lib/command.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commands = exports.cmd = void 0;
4
+
5
+ exports.cmd = () => {};
6
+ exports.commands = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amiudmodz",
3
- "version": "4.0.0",
3
+ "version": "4.0.5",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "files": [
@@ -90,4 +90,4 @@
90
90
  "engines": {
91
91
  "node": ">=20.0.0"
92
92
  }
93
- }
93
+ }