baileyz 1.0.8 → 1.1.0
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/newsletter.js
CHANGED
|
@@ -5,20 +5,64 @@ const Types_1 = require("../Types");
|
|
|
5
5
|
const Utils_1 = require("../Utils");
|
|
6
6
|
const WABinary_1 = require("../WABinary");
|
|
7
7
|
const groups_1 = require("./groups");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
|
|
9
|
+
const { Boom } = require('@hapi/boom');
|
|
10
|
+
|
|
11
|
+
const wMexQuery = (
|
|
12
|
+
variables,
|
|
13
|
+
queryId,
|
|
14
|
+
query,
|
|
15
|
+
generateMessageTag
|
|
16
|
+
) => {
|
|
17
|
+
return query({
|
|
18
|
+
tag: 'iq',
|
|
19
|
+
attrs: {
|
|
20
|
+
id: generateMessageTag(),
|
|
21
|
+
type: 'get',
|
|
22
|
+
to: WABinary_1.S_WHATSAPP_NET,
|
|
23
|
+
xmlns: 'w:mex'
|
|
24
|
+
},
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
tag: 'query',
|
|
28
|
+
attrs: { query_id: queryId },
|
|
29
|
+
content: Buffer.from(JSON.stringify({ variables }), 'utf-8')
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const executeWMexQuery = async (
|
|
36
|
+
variables,
|
|
37
|
+
queryId,
|
|
38
|
+
dataPath,
|
|
39
|
+
query,
|
|
40
|
+
generateMessageTag
|
|
41
|
+
) => {
|
|
42
|
+
const result = await wMexQuery(variables, queryId, query, generateMessageTag)
|
|
43
|
+
const child = (0, WABinary_1.getBinaryNodeChild)(result, 'result')
|
|
44
|
+
if (child?.content) {
|
|
45
|
+
const data = JSON.parse(child.content.toString())
|
|
46
|
+
|
|
47
|
+
if (data.errors && data.errors.length > 0) {
|
|
48
|
+
const errorMessages = data.errors.map((err) => err.message || 'Unknown error').join(', ')
|
|
49
|
+
const firstError = data.errors[0]
|
|
50
|
+
const errorCode = firstError.extensions?.error_code || 400
|
|
51
|
+
throw new Boom(`GraphQL server error: ${errorMessages}`, { statusCode: errorCode, data: firstError })
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const response = dataPath ? data?.data?.[dataPath] : data?.data
|
|
55
|
+
if (typeof response !== 'undefined') {
|
|
56
|
+
return response
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const action = (dataPath || '').startsWith('xwa2_')
|
|
61
|
+
? dataPath.substring(5).replace(/_/g, ' ')
|
|
62
|
+
: dataPath?.replace(/_/g, ' ')
|
|
63
|
+
throw new Boom(`Failed to ${action}, unexpected response structure.`, { statusCode: 400, data: result })
|
|
64
|
+
}
|
|
65
|
+
|
|
22
66
|
const makeNewsletterSocket = (config) => {
|
|
23
67
|
const sock = (0, groups_1.makeGroupsSocket)(config);
|
|
24
68
|
const { authState, signalRepository, query, generateMessageTag } = sock;
|
|
@@ -33,7 +77,7 @@ const makeNewsletterSocket = (config) => {
|
|
|
33
77
|
},
|
|
34
78
|
content
|
|
35
79
|
}));
|
|
36
|
-
const newsletterWMexQuery = async (jid,
|
|
80
|
+
const newsletterWMexQuery = async (jid, queryId, content) => (query({
|
|
37
81
|
tag: 'iq',
|
|
38
82
|
attrs: {
|
|
39
83
|
id: generateMessageTag(),
|
|
@@ -44,7 +88,7 @@ const makeNewsletterSocket = (config) => {
|
|
|
44
88
|
content: [
|
|
45
89
|
{
|
|
46
90
|
tag: 'query',
|
|
47
|
-
attrs: { query_id },
|
|
91
|
+
attrs: { 'query_id': queryId },
|
|
48
92
|
content: encoder.encode(JSON.stringify({
|
|
49
93
|
variables: {
|
|
50
94
|
'newsletter_id': jid,
|
|
@@ -54,31 +98,12 @@ const makeNewsletterSocket = (config) => {
|
|
|
54
98
|
}
|
|
55
99
|
]
|
|
56
100
|
}));
|
|
57
|
-
|
|
58
|
-
try {
|
|
59
|
-
const result = await newsletterWMexQuery(jid, QueryIds.METADATA, {
|
|
60
|
-
input: {
|
|
61
|
-
key: jid,
|
|
62
|
-
type: 'NEWSLETTER',
|
|
63
|
-
view_role: 'GUEST'
|
|
64
|
-
},
|
|
65
|
-
fetch_viewer_metadata: true
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
const buff = (0, WABinary_1.getBinaryNodeChild)(result, 'result')?.content?.toString();
|
|
69
|
-
if (!buff) return false;
|
|
70
|
-
|
|
71
|
-
const data = JSON.parse(buff).data[Types_1.XWAPaths.NEWSLETTER];
|
|
72
|
-
return data?.viewer_metadata?.is_subscribed === true;
|
|
73
|
-
} catch {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
101
|
+
|
|
78
102
|
const parseFetchedUpdates = async (node, type) => {
|
|
79
103
|
let child;
|
|
80
|
-
if (type === 'messages')
|
|
104
|
+
if (type === 'messages') {
|
|
81
105
|
child = (0, WABinary_1.getBinaryNodeChild)(node, 'messages');
|
|
106
|
+
}
|
|
82
107
|
else {
|
|
83
108
|
const parent = (0, WABinary_1.getBinaryNodeChild)(node, 'message_updates');
|
|
84
109
|
child = (0, WABinary_1.getBinaryNodeChild)(parent, 'messages');
|
|
@@ -105,50 +130,86 @@ const makeNewsletterSocket = (config) => {
|
|
|
105
130
|
};
|
|
106
131
|
return {
|
|
107
132
|
...sock,
|
|
133
|
+
newsletterFetchAllSubscribe: async () => {
|
|
134
|
+
const list = await executeWMexQuery(
|
|
135
|
+
{},
|
|
136
|
+
'6388546374527196',
|
|
137
|
+
'xwa2_newsletter_subscribed',
|
|
138
|
+
query,
|
|
139
|
+
generateMessageTag
|
|
140
|
+
);
|
|
141
|
+
return list;
|
|
142
|
+
},
|
|
108
143
|
subscribeNewsletterUpdates: async (jid) => {
|
|
109
144
|
var _a;
|
|
110
145
|
const result = await newsletterQuery(jid, 'set', [{ tag: 'live_updates', attrs: {}, content: [] }]);
|
|
111
146
|
return (_a = (0, WABinary_1.getBinaryNodeChild)(result, 'live_updates')) === null || _a === void 0 ? void 0 : _a.attrs;
|
|
112
147
|
},
|
|
113
148
|
newsletterReactionMode: async (jid, mode) => {
|
|
114
|
-
await newsletterWMexQuery(jid, QueryIds.JOB_MUTATION, {
|
|
115
|
-
updates: { settings: { reaction_codes: { value: mode } } }
|
|
149
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
150
|
+
updates: { settings: { 'reaction_codes': { value: mode } } }
|
|
116
151
|
});
|
|
117
152
|
},
|
|
118
153
|
newsletterUpdateDescription: async (jid, description) => {
|
|
119
|
-
await newsletterWMexQuery(jid, QueryIds.JOB_MUTATION, {
|
|
154
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
120
155
|
updates: { description: description || '', settings: null }
|
|
121
156
|
});
|
|
122
157
|
},
|
|
158
|
+
newsletterId: async (url) => {
|
|
159
|
+
const urlParts = url.split('/');
|
|
160
|
+
const channelId = urlParts[urlParts.length - 2];
|
|
161
|
+
|
|
162
|
+
const result = await newsletterWMexQuery(undefined, Types_1.QueryIds.METADATA, {
|
|
163
|
+
input: {
|
|
164
|
+
key: channelId,
|
|
165
|
+
type: 'INVITE',
|
|
166
|
+
'view_role': 'GUEST'
|
|
167
|
+
},
|
|
168
|
+
'fetch_viewer_metadata': true,
|
|
169
|
+
'fetch_full_image': true,
|
|
170
|
+
'fetch_creation_time': true
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const metadata = extractNewsletterMetadata(result);
|
|
174
|
+
return JSON.stringify({
|
|
175
|
+
name: metadata.name || metadata.thread_metadata?.name?.text,
|
|
176
|
+
id: metadata.id
|
|
177
|
+
}, null, 2);
|
|
178
|
+
},
|
|
123
179
|
newsletterUpdateName: async (jid, name) => {
|
|
124
|
-
await newsletterWMexQuery(jid, QueryIds.JOB_MUTATION, {
|
|
180
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
125
181
|
updates: { name, settings: null }
|
|
126
182
|
});
|
|
127
183
|
},
|
|
128
184
|
newsletterUpdatePicture: async (jid, content) => {
|
|
129
185
|
const { img } = await (0, Utils_1.generateProfilePicture)(content);
|
|
130
|
-
await newsletterWMexQuery(jid, QueryIds.JOB_MUTATION, {
|
|
186
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
131
187
|
updates: { picture: img.toString('base64'), settings: null }
|
|
132
188
|
});
|
|
133
189
|
},
|
|
134
190
|
newsletterRemovePicture: async (jid) => {
|
|
135
|
-
await newsletterWMexQuery(jid, QueryIds.JOB_MUTATION, {
|
|
191
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
136
192
|
updates: { picture: '', settings: null }
|
|
137
193
|
});
|
|
138
194
|
},
|
|
139
195
|
newsletterUnfollow: async (jid) => {
|
|
140
|
-
await newsletterWMexQuery(jid, QueryIds.UNFOLLOW);
|
|
196
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.UNFOLLOW);
|
|
141
197
|
},
|
|
142
198
|
newsletterFollow: async (jid) => {
|
|
143
|
-
await newsletterWMexQuery(jid, QueryIds.FOLLOW);
|
|
199
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.FOLLOW);
|
|
144
200
|
},
|
|
145
201
|
newsletterUnmute: async (jid) => {
|
|
146
|
-
await newsletterWMexQuery(jid, QueryIds.UNMUTE);
|
|
202
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.UNMUTE);
|
|
147
203
|
},
|
|
148
204
|
newsletterMute: async (jid) => {
|
|
149
|
-
await newsletterWMexQuery(jid, QueryIds.MUTE);
|
|
205
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.MUTE);
|
|
150
206
|
},
|
|
151
|
-
|
|
207
|
+
newsletterAction: async (jid, type) => {
|
|
208
|
+
await newsletterWMexQuery(jid, type.toUpperCase());
|
|
209
|
+
},
|
|
210
|
+
newsletterCreate: async (name, description, reaction_codes) => {
|
|
211
|
+
//TODO: Implement TOS system wide for Meta AI, communities, and here etc.
|
|
212
|
+
/**tos query */
|
|
152
213
|
await query({
|
|
153
214
|
tag: 'iq',
|
|
154
215
|
attrs: {
|
|
@@ -168,55 +229,50 @@ const makeNewsletterSocket = (config) => {
|
|
|
168
229
|
}
|
|
169
230
|
]
|
|
170
231
|
});
|
|
171
|
-
const result = await newsletterWMexQuery(undefined, QueryIds.CREATE, {
|
|
172
|
-
input: {
|
|
173
|
-
name,
|
|
174
|
-
description: description !== null && description !== void 0 ? description : null,
|
|
175
|
-
picture: picture ? (await (0, Utils_1.generateProfilePicture)(picture)).img.toString('base64') : null,
|
|
176
|
-
settings: null
|
|
177
|
-
}
|
|
232
|
+
const result = await newsletterWMexQuery(undefined, Types_1.QueryIds.CREATE, {
|
|
233
|
+
input: { name, description, settings: { 'reaction_codes': { value: reaction_codes.toUpperCase() } } }
|
|
178
234
|
});
|
|
179
235
|
return (0, exports.extractNewsletterMetadata)(result, true);
|
|
180
236
|
},
|
|
181
237
|
newsletterMetadata: async (type, key, role) => {
|
|
182
|
-
const result = await newsletterWMexQuery(undefined, QueryIds.METADATA, {
|
|
238
|
+
const result = await newsletterWMexQuery(undefined, Types_1.QueryIds.METADATA, {
|
|
183
239
|
input: {
|
|
184
240
|
key,
|
|
185
241
|
type: type.toUpperCase(),
|
|
186
|
-
view_role: role || 'GUEST'
|
|
242
|
+
'view_role': role || 'GUEST'
|
|
187
243
|
},
|
|
188
|
-
fetch_viewer_metadata: true,
|
|
189
|
-
fetch_full_image: true,
|
|
190
|
-
fetch_creation_time: true
|
|
244
|
+
'fetch_viewer_metadata': true,
|
|
245
|
+
'fetch_full_image': true,
|
|
246
|
+
'fetch_creation_time': true
|
|
191
247
|
});
|
|
192
248
|
return (0, exports.extractNewsletterMetadata)(result);
|
|
193
249
|
},
|
|
194
250
|
newsletterAdminCount: async (jid) => {
|
|
195
251
|
var _a, _b;
|
|
196
|
-
const result = await newsletterWMexQuery(jid, QueryIds.ADMIN_COUNT);
|
|
252
|
+
const result = await newsletterWMexQuery(jid, Types_1.QueryIds.ADMIN_COUNT);
|
|
197
253
|
const buff = (_b = (_a = (0, WABinary_1.getBinaryNodeChild)(result, 'result')) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.toString();
|
|
198
254
|
return JSON.parse(buff).data[Types_1.XWAPaths.ADMIN_COUNT].admin_count;
|
|
199
255
|
},
|
|
200
256
|
/**user is Lid, not Jid */
|
|
201
257
|
newsletterChangeOwner: async (jid, user) => {
|
|
202
|
-
await newsletterWMexQuery(jid, QueryIds.CHANGE_OWNER, {
|
|
203
|
-
user_id: user
|
|
258
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.CHANGE_OWNER, {
|
|
259
|
+
'user_id': user
|
|
204
260
|
});
|
|
205
261
|
},
|
|
206
262
|
/**user is Lid, not Jid */
|
|
207
263
|
newsletterDemote: async (jid, user) => {
|
|
208
|
-
await newsletterWMexQuery(jid, QueryIds.DEMOTE, {
|
|
209
|
-
user_id: user
|
|
264
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.DEMOTE, {
|
|
265
|
+
'user_id': user
|
|
210
266
|
});
|
|
211
267
|
},
|
|
212
268
|
newsletterDelete: async (jid) => {
|
|
213
|
-
await newsletterWMexQuery(jid, QueryIds.DELETE);
|
|
269
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.DELETE);
|
|
214
270
|
},
|
|
215
271
|
/**if code wasn't passed, the reaction will be removed (if is reacted) */
|
|
216
|
-
newsletterReactMessage: async (jid,
|
|
272
|
+
newsletterReactMessage: async (jid, serverId, code) => {
|
|
217
273
|
await query({
|
|
218
274
|
tag: 'message',
|
|
219
|
-
attrs: { to: jid, ...(!code ? { edit: '7' } : {}), type: 'reaction', server_id, id: (0, Utils_1.generateMessageID)() },
|
|
275
|
+
attrs: { to: jid, ...(!code ? { edit: '7' } : {}), type: 'reaction', 'server_id': serverId, id: (0, Utils_1.generateMessageID)() },
|
|
220
276
|
content: [{
|
|
221
277
|
tag: 'reaction',
|
|
222
278
|
attrs: code ? { code } : {}
|
|
@@ -224,11 +280,10 @@ const makeNewsletterSocket = (config) => {
|
|
|
224
280
|
});
|
|
225
281
|
},
|
|
226
282
|
newsletterFetchMessages: async (type, key, count, after) => {
|
|
227
|
-
const afterStr = after === null || after === void 0 ? void 0 : after.toString();
|
|
228
283
|
const result = await newsletterQuery(WABinary_1.S_WHATSAPP_NET, 'get', [
|
|
229
284
|
{
|
|
230
285
|
tag: 'messages',
|
|
231
|
-
attrs: { type, ...(type === 'invite' ? { key } : { jid: key }), count: count.toString(), after:
|
|
286
|
+
attrs: { type, ...(type === 'invite' ? { key } : { jid: key }), count: count.toString(), after: (after === null || after === void 0 ? void 0 : after.toString()) || '100' }
|
|
232
287
|
}
|
|
233
288
|
]);
|
|
234
289
|
return await parseFetchedUpdates(result, 'messages');
|
|
@@ -246,26 +301,25 @@ const makeNewsletterSocket = (config) => {
|
|
|
246
301
|
};
|
|
247
302
|
exports.makeNewsletterSocket = makeNewsletterSocket;
|
|
248
303
|
const extractNewsletterMetadata = (node, isCreate) => {
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
|
|
304
|
+
const result = WABinary_1.getBinaryNodeChild(node, 'result')?.content?.toString()
|
|
305
|
+
const metadataPath = JSON.parse(result).data[isCreate ? Types_1.XWAPaths.CREATE : Types_1.XWAPaths.NEWSLETTER]
|
|
306
|
+
|
|
252
307
|
const metadata = {
|
|
253
|
-
id: metadataPath
|
|
254
|
-
state: metadataPath
|
|
255
|
-
creation_time: +metadataPath
|
|
256
|
-
name: metadataPath
|
|
257
|
-
nameTime: +metadataPath
|
|
258
|
-
description: metadataPath
|
|
259
|
-
descriptionTime: +metadataPath
|
|
260
|
-
invite: metadataPath
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
};
|
|
308
|
+
id: metadataPath?.id,
|
|
309
|
+
state: metadataPath?.state?.type,
|
|
310
|
+
creation_time: +metadataPath?.thread_metadata?.creation_time,
|
|
311
|
+
name: metadataPath?.thread_metadata?.name?.text,
|
|
312
|
+
nameTime: +metadataPath?.thread_metadata?.name?.update_time,
|
|
313
|
+
description: metadataPath?.thread_metadata?.description?.text,
|
|
314
|
+
descriptionTime: +metadataPath?.thread_metadata?.description?.update_time,
|
|
315
|
+
invite: metadataPath?.thread_metadata?.invite,
|
|
316
|
+
picture: Utils_1.getUrlFromDirectPath(metadataPath?.thread_metadata?.picture?.direct_path || ''),
|
|
317
|
+
preview: Utils_1.getUrlFromDirectPath(metadataPath?.thread_metadata?.preview?.direct_path || ''),
|
|
318
|
+
reaction_codes: metadataPath?.thread_metadata?.settings?.reaction_codes?.value,
|
|
319
|
+
subscribers: +metadataPath?.thread_metadata?.subscribers_count,
|
|
320
|
+
verification: metadataPath?.thread_metadata?.verification,
|
|
321
|
+
viewer_metadata: metadataPath?.viewer_metadata
|
|
322
|
+
}
|
|
323
|
+
return metadata
|
|
324
|
+
}
|
|
271
325
|
exports.extractNewsletterMetadata = extractNewsletterMetadata;
|
package/lib/Utils/generics.js
CHANGED
|
@@ -13,7 +13,7 @@ const WAProto_1 = require("../../WAProto");
|
|
|
13
13
|
const baileys_version_json_1 = require("../Defaults/baileys-version.json");
|
|
14
14
|
const Types_1 = require("../Types");
|
|
15
15
|
const WABinary_1 = require("../WABinary");
|
|
16
|
-
const baileysVersion = [2, 3000,
|
|
16
|
+
const baileysVersion = [2, 3000, 1029030078]
|
|
17
17
|
const PLATFORM_MAP = {
|
|
18
18
|
'aix': 'AIX',
|
|
19
19
|
'darwin': 'Mac OS',
|
|
@@ -273,7 +273,7 @@ exports.fetchLatestWaWebVersion = fetchLatestWaWebVersion;
|
|
|
273
273
|
* Use to ensure your WA connection is always on the latest version
|
|
274
274
|
*/
|
|
275
275
|
const fetchLatestBaileysVersion = async (options = {}) => {
|
|
276
|
-
const URL = 'https://raw.githubusercontent.com/kiuur/
|
|
276
|
+
const URL = 'https://raw.githubusercontent.com/kiuur/baileys/master/src/Defaults/baileys-version.json';
|
|
277
277
|
try {
|
|
278
278
|
const result = await axios_1.default.get(URL, {
|
|
279
279
|
...options,
|
|
@@ -17,7 +17,7 @@ const getUserAgent = (config) => {
|
|
|
17
17
|
secondary: config.version[1],
|
|
18
18
|
tertiary: config.version[2],
|
|
19
19
|
},
|
|
20
|
-
platform: WAProto_1.proto.ClientPayload.UserAgent.Platform.
|
|
20
|
+
platform: WAProto_1.proto.ClientPayload.UserAgent.Platform.WEB,
|
|
21
21
|
releaseChannel: WAProto_1.proto.ClientPayload.UserAgent.ReleaseChannel.RELEASE,
|
|
22
22
|
osVersion: '0.1',
|
|
23
23
|
device: 'Desktop',
|
package/lib/index.js
CHANGED
|
@@ -2,15 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
const chalk = require("chalk");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
const rainbow = (text) => {
|
|
6
|
+
const colors = [
|
|
7
|
+
chalk.redBright,
|
|
8
|
+
chalk.yellowBright,
|
|
9
|
+
chalk.greenBright,
|
|
10
|
+
chalk.cyanBright,
|
|
11
|
+
chalk.blueBright,
|
|
12
|
+
chalk.magentaBright
|
|
13
|
+
];
|
|
14
|
+
return text
|
|
15
|
+
.split("")
|
|
16
|
+
.map((char, i) => colors[i % colors.length](char))
|
|
17
|
+
.join("");
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
console.log(chalk.magentaBright.bold("\n╔══════════════════════════════════════════════╗"));
|
|
21
|
+
console.log(
|
|
22
|
+
chalk.magentaBright.bold("║") +
|
|
23
|
+
rainbow(" ✨ DanuZz Baileyz ✨ ") +
|
|
24
|
+
chalk.magentaBright.bold("║")
|
|
25
|
+
);
|
|
26
|
+
console.log(chalk.magentaBright.bold("╚══════════════════════════════════════════════╝\n"));
|
|
27
|
+
|
|
28
|
+
console.log(rainbow(" Hi, thank you for using my modified Baileys ^-^ \n"));
|
|
29
|
+
|
|
30
|
+
console.log(chalk.cyanBright("👨💻 Developer: ") + chalk.greenBright.bold("@DanuZz"));
|
|
31
|
+
console.log(chalk.gray("═".repeat(54)));
|
|
32
|
+
|
|
33
|
+
const latestUpdate = new Date("2026-03-25");
|
|
34
|
+
console.log(
|
|
35
|
+
chalk.yellowBright("🆕 Latest update: ") +
|
|
36
|
+
chalk.whiteBright(latestUpdate.toLocaleDateString())
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
console.log(chalk.gray("═".repeat(54) + "\n"));
|
|
40
|
+
|
|
41
|
+
console.log(rainbow(" 🚀 Enjoy the features & stay connected! 🚀 \n"));
|
|
14
42
|
|
|
15
43
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
44
|
if (k2 === undefined) k2 = k;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "baileyz",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "WhatsApp Web API Library Modification By DanuZz",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"whatsapp-group",
|
|
12
12
|
"whatsapp-bot",
|
|
13
13
|
"automation",
|
|
14
|
-
"js-whatsapp",
|
|
15
|
-
"whatsapp-api",
|
|
14
|
+
"js-whatsapp",
|
|
15
|
+
"whatsapp-api",
|
|
16
16
|
"baileys-mod",
|
|
17
17
|
"botwa",
|
|
18
18
|
"danuzz"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
50
|
-
"@hapi/boom": "^9.1.3",
|
|
51
50
|
"@cacheable/node-cache": "^1.4.0",
|
|
51
|
+
"@hapi/boom": "^9.1.3",
|
|
52
52
|
"async-mutex": "^0.5.0",
|
|
53
53
|
"audio-decode": "^2.1.3",
|
|
54
54
|
"axios": "^1.3.3",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"chalk": "^4.1.2",
|
|
57
57
|
"futoin-hkdf": "^1.5.1",
|
|
58
58
|
"libphonenumber-js": "^1.10.20",
|
|
59
|
+
"libsignal": "npm:@dnuzi/libsignal-node",
|
|
59
60
|
"lodash": "^4.17.21",
|
|
60
|
-
"libsignal": "npm:@shennmine/libsignal-node",
|
|
61
61
|
"music-metadata": "^7.12.3",
|
|
62
62
|
"node-cache": "^5.1.2",
|
|
63
63
|
"node-fetch": "^2.6.1",
|
|
@@ -74,9 +74,10 @@
|
|
|
74
74
|
"@types/sharp": "^0.29.4",
|
|
75
75
|
"@types/ws": "^8.0.0",
|
|
76
76
|
"conventional-changelog-cli": "^2.2.2",
|
|
77
|
-
"eslint": "^
|
|
77
|
+
"eslint": "^10.1.0",
|
|
78
78
|
"jest": "^27.0.6",
|
|
79
79
|
"jimp": "^0.16.1",
|
|
80
|
+
"json": "^11.0.0",
|
|
80
81
|
"link-preview-js": "^3.0.0",
|
|
81
82
|
"open": "^8.4.2",
|
|
82
83
|
"qrcode-terminal": "^0.12.0",
|
|
@@ -85,8 +86,7 @@
|
|
|
85
86
|
"ts-jest": "^27.0.3",
|
|
86
87
|
"ts-node": "^10.8.1",
|
|
87
88
|
"typedoc": "^0.24.7",
|
|
88
|
-
"typescript": "^4.6.4"
|
|
89
|
-
"json": "^11.0.0"
|
|
89
|
+
"typescript": "^4.6.4"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"jimp": "^0.16.1",
|