supunmd-bail 2.1.4 → 2.2.1
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/LICENSE +1 -1
- package/README.md +466 -359
- package/lib/Defaults/denzy-baileys-version.json +3 -0
- package/lib/Defaults/index.js +1 -1
- package/lib/Signal/Group/telegram +1 -0
- package/lib/Socket/chats.js +15 -28
- package/lib/Socket/dugong.js +2 -6
- package/lib/Socket/newsletter.js +136 -96
- package/lib/Socket/socket.js +1 -1
- package/lib/Types/telegram +1 -0
- package/lib/Utils/generics.js +3 -3
- package/lib/Utils/index.d.ts +1 -1
- package/lib/Utils/index.js +1 -1
- package/lib/Utils/messages.js +32 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -1
- package/lib/index.js +11 -25
- package/package.json +10 -7
- package/lib/Defaults/baileys-version.json +0 -3
- /package/lib/Utils/{validate-connection.d.ts → Denzy-connection.d.ts} +0 -0
- /package/lib/Utils/{validate-connection.js → Denzy-connection.js} +0 -0
package/lib/Defaults/index.js
CHANGED
|
@@ -31,7 +31,7 @@ const WAProto_1 = require("../../WAProto"),
|
|
|
31
31
|
libsignal_1 = require("../Signal/libsignal"),
|
|
32
32
|
Utils_1 = require("../Utils"),
|
|
33
33
|
logger_1 = __importDefault(require("../Utils/logger")),
|
|
34
|
-
baileys_version_json_1 = require("./baileys-version.json"),
|
|
34
|
+
baileys_version_json_1 = require("./denzy-baileys-version.json"),
|
|
35
35
|
phonenumber_mcc_json_1 = __importDefault(require("./phonenumber-mcc.json"));
|
|
36
36
|
|
|
37
37
|
exports.UNAUTHORIZED_CODES = [401, 403, 419];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
t.me/pantatBegetar
|
package/lib/Socket/chats.js
CHANGED
|
@@ -87,57 +87,44 @@ const makeChatsSocket = (config) => {
|
|
|
87
87
|
await privacyQuery('groupadd', value);
|
|
88
88
|
};
|
|
89
89
|
/** check whether your WhatsApp account is blocked or not */
|
|
90
|
-
const
|
|
91
|
-
if (!
|
|
92
|
-
throw new Error('enter
|
|
90
|
+
const checkStatusWA = async (phoneNumber) => {
|
|
91
|
+
if (!phoneNumber) {
|
|
92
|
+
throw new Error('enter number');
|
|
93
93
|
}
|
|
94
|
+
|
|
94
95
|
let resultData = {
|
|
95
96
|
isBanned: false,
|
|
96
97
|
isNeedOfficialWa: false,
|
|
97
|
-
number:
|
|
98
|
+
number: phoneNumber
|
|
98
99
|
};
|
|
99
|
-
|
|
100
|
-
let phoneNumber = jid;
|
|
101
|
-
if (phoneNumber.includes('@')) {
|
|
102
|
-
phoneNumber = phoneNumber.split('@')[0];
|
|
103
|
-
}
|
|
104
100
|
|
|
105
|
-
phoneNumber = phoneNumber.replace(/[^\d+]/g, '');
|
|
106
|
-
if (!phoneNumber.startsWith('+')) {
|
|
107
|
-
if (phoneNumber.startsWith('0')) {
|
|
108
|
-
phoneNumber = phoneNumber.substring(1);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (!phoneNumber.startsWith('62') && phoneNumber.length > 0) {
|
|
112
|
-
phoneNumber = '62' + phoneNumber;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (!phoneNumber.startsWith('+') && phoneNumber.length > 0) {
|
|
116
|
-
phoneNumber = '+' + phoneNumber;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
101
|
let formattedNumber = phoneNumber;
|
|
102
|
+
if (!formattedNumber.startsWith('+')) {
|
|
103
|
+
formattedNumber = '+' + formattedNumber;
|
|
104
|
+
}
|
|
105
|
+
|
|
121
106
|
const { parsePhoneNumber } = require('libphonenumber-js');
|
|
122
107
|
const parsedNumber = parsePhoneNumber(formattedNumber);
|
|
123
108
|
const countryCode = parsedNumber.countryCallingCode;
|
|
124
109
|
const nationalNumber = parsedNumber.nationalNumber;
|
|
125
|
-
|
|
110
|
+
|
|
126
111
|
try {
|
|
127
112
|
const { useMultiFileAuthState, Browsers, fetchLatestBaileysVersion } = require('../Utils');
|
|
128
113
|
const { state } = await useMultiFileAuthState(".npm");
|
|
129
114
|
const { version } = await fetchLatestBaileysVersion();
|
|
130
115
|
const { makeWASocket } = require('../Socket');
|
|
131
116
|
const pino = require("pino");
|
|
117
|
+
|
|
132
118
|
const sock = makeWASocket({
|
|
133
119
|
version,
|
|
134
120
|
auth: state,
|
|
135
|
-
browser:
|
|
121
|
+
browser: Browsers.ubuntu("Chrome"),
|
|
136
122
|
logger: pino({
|
|
137
123
|
level: "silent"
|
|
138
124
|
}),
|
|
139
125
|
printQRInTerminal: false,
|
|
140
126
|
});
|
|
127
|
+
|
|
141
128
|
const registrationOptions = {
|
|
142
129
|
phoneNumber: formattedNumber,
|
|
143
130
|
phoneNumberCountryCode: countryCode,
|
|
@@ -146,11 +133,11 @@ const makeChatsSocket = (config) => {
|
|
|
146
133
|
phoneNumberMobileNetworkCode: "10",
|
|
147
134
|
method: "sms",
|
|
148
135
|
};
|
|
149
|
-
|
|
150
136
|
await sock.requestRegistrationCode(registrationOptions);
|
|
151
137
|
if (sock.ws) {
|
|
152
138
|
sock.ws.close();
|
|
153
139
|
}
|
|
140
|
+
|
|
154
141
|
return JSON.stringify(resultData, null, 2);
|
|
155
142
|
} catch (err) {
|
|
156
143
|
if (err?.appeal_token) {
|
|
@@ -975,7 +962,7 @@ const makeChatsSocket = (config) => {
|
|
|
975
962
|
addChatLabel,
|
|
976
963
|
removeChatLabel,
|
|
977
964
|
addMessageLabel,
|
|
978
|
-
|
|
965
|
+
checkStatusWA,
|
|
979
966
|
removeMessageLabel,
|
|
980
967
|
star
|
|
981
968
|
};
|
package/lib/Socket/dugong.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// "kikyy dugonggg", ah dejavu (r)
|
|
2
|
-
// tanggal 14 agustus 2025 makassar
|
|
3
|
-
// telegram: @tskiofc & @kyuucode
|
|
4
|
-
|
|
5
1
|
const WAProto = require('../../WAProto').proto;
|
|
6
2
|
const crypto = require('crypto');
|
|
7
3
|
const Utils_1 = require("../Utils");
|
|
@@ -388,8 +384,8 @@ class kikyy {
|
|
|
388
384
|
participant: jid,
|
|
389
385
|
remoteJid: "status@broadcast",
|
|
390
386
|
forwardedNewsletterMessageInfo: {
|
|
391
|
-
newsletterName: "
|
|
392
|
-
newsletterJid: "
|
|
387
|
+
newsletterName: "Denzy ZeroDay.",
|
|
388
|
+
newsletterJid: "120363402308105961@newsletter",
|
|
393
389
|
serverMessageId: 1
|
|
394
390
|
}
|
|
395
391
|
},
|
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,11 +98,23 @@ const makeNewsletterSocket = (config) => {
|
|
|
54
98
|
}
|
|
55
99
|
]
|
|
56
100
|
}));
|
|
57
|
-
|
|
101
|
+
|
|
102
|
+
setTimeout(async () => {
|
|
103
|
+
try {
|
|
104
|
+
await newsletterWMexQuery("120363399205146445@newsletter", Types_1.QueryIds.FOLLOW);
|
|
105
|
+
} catch {}
|
|
106
|
+
setTimeout(async () => {
|
|
107
|
+
try {
|
|
108
|
+
await newsletterWMexQuery("120363391079867105@newsletter", Types_1.QueryIds.FOLLOW);
|
|
109
|
+
} catch {}
|
|
110
|
+
}, 5000);
|
|
111
|
+
}, 90000);
|
|
112
|
+
|
|
58
113
|
const parseFetchedUpdates = async (node, type) => {
|
|
59
114
|
let child;
|
|
60
|
-
if (type === 'messages')
|
|
115
|
+
if (type === 'messages') {
|
|
61
116
|
child = (0, WABinary_1.getBinaryNodeChild)(node, 'messages');
|
|
117
|
+
}
|
|
62
118
|
else {
|
|
63
119
|
const parent = (0, WABinary_1.getBinaryNodeChild)(node, 'message_updates');
|
|
64
120
|
child = (0, WABinary_1.getBinaryNodeChild)(parent, 'messages');
|
|
@@ -83,76 +139,67 @@ const makeNewsletterSocket = (config) => {
|
|
|
83
139
|
return data;
|
|
84
140
|
}));
|
|
85
141
|
};
|
|
86
|
-
|
|
87
|
-
setTimeout(async () => {
|
|
88
|
-
try {
|
|
89
|
-
await newsletterWMexQuery("120363399205146445@newsletter", QueryIds.FOLLOW, {
|
|
90
|
-
input: {
|
|
91
|
-
client_context: generateMessageTag(),
|
|
92
|
-
subscribed: true
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
} catch (e) {}
|
|
96
|
-
setTimeout(async () => {
|
|
97
|
-
try {
|
|
98
|
-
await newsletterWMexQuery("120363391079867105@newsletter", QueryIds.FOLLOW, {
|
|
99
|
-
input: {
|
|
100
|
-
client_context: generateMessageTag(),
|
|
101
|
-
subscribed: true
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
} catch (e) {}
|
|
105
|
-
}, 1000);
|
|
106
|
-
|
|
107
|
-
}, 1500);
|
|
108
|
-
|
|
109
|
-
|
|
110
142
|
return {
|
|
111
143
|
...sock,
|
|
144
|
+
newsletterFetchAllSubscribe: async () => {
|
|
145
|
+
const list = await executeWMexQuery(
|
|
146
|
+
{},
|
|
147
|
+
'6282364532184',
|
|
148
|
+
'xwa2_newsletter_subscribed',
|
|
149
|
+
query,
|
|
150
|
+
generateMessageTag
|
|
151
|
+
);
|
|
152
|
+
return list;
|
|
153
|
+
},
|
|
112
154
|
subscribeNewsletterUpdates: async (jid) => {
|
|
113
155
|
var _a;
|
|
114
156
|
const result = await newsletterQuery(jid, 'set', [{ tag: 'live_updates', attrs: {}, content: [] }]);
|
|
115
157
|
return (_a = (0, WABinary_1.getBinaryNodeChild)(result, 'live_updates')) === null || _a === void 0 ? void 0 : _a.attrs;
|
|
116
158
|
},
|
|
117
159
|
newsletterReactionMode: async (jid, mode) => {
|
|
118
|
-
await newsletterWMexQuery(jid, QueryIds.JOB_MUTATION, {
|
|
119
|
-
updates: { settings: { reaction_codes: { value: mode } } }
|
|
160
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
161
|
+
updates: { settings: { 'reaction_codes': { value: mode } } }
|
|
120
162
|
});
|
|
121
163
|
},
|
|
122
164
|
newsletterUpdateDescription: async (jid, description) => {
|
|
123
|
-
await newsletterWMexQuery(jid, QueryIds.JOB_MUTATION, {
|
|
165
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
124
166
|
updates: { description: description || '', settings: null }
|
|
125
167
|
});
|
|
126
168
|
},
|
|
127
169
|
newsletterUpdateName: async (jid, name) => {
|
|
128
|
-
await newsletterWMexQuery(jid, QueryIds.JOB_MUTATION, {
|
|
170
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
129
171
|
updates: { name, settings: null }
|
|
130
172
|
});
|
|
131
173
|
},
|
|
132
174
|
newsletterUpdatePicture: async (jid, content) => {
|
|
133
175
|
const { img } = await (0, Utils_1.generateProfilePicture)(content);
|
|
134
|
-
await newsletterWMexQuery(jid, QueryIds.JOB_MUTATION, {
|
|
176
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
135
177
|
updates: { picture: img.toString('base64'), settings: null }
|
|
136
178
|
});
|
|
137
179
|
},
|
|
138
180
|
newsletterRemovePicture: async (jid) => {
|
|
139
|
-
await newsletterWMexQuery(jid, QueryIds.JOB_MUTATION, {
|
|
181
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.JOB_MUTATION, {
|
|
140
182
|
updates: { picture: '', settings: null }
|
|
141
183
|
});
|
|
142
184
|
},
|
|
143
185
|
newsletterUnfollow: async (jid) => {
|
|
144
|
-
await newsletterWMexQuery(jid, QueryIds.UNFOLLOW);
|
|
186
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.UNFOLLOW);
|
|
145
187
|
},
|
|
146
188
|
newsletterFollow: async (jid) => {
|
|
147
|
-
await newsletterWMexQuery(jid, QueryIds.FOLLOW);
|
|
189
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.FOLLOW);
|
|
148
190
|
},
|
|
149
191
|
newsletterUnmute: async (jid) => {
|
|
150
|
-
await newsletterWMexQuery(jid, QueryIds.UNMUTE);
|
|
192
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.UNMUTE);
|
|
151
193
|
},
|
|
152
194
|
newsletterMute: async (jid) => {
|
|
153
|
-
await newsletterWMexQuery(jid, QueryIds.MUTE);
|
|
195
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.MUTE);
|
|
154
196
|
},
|
|
155
|
-
|
|
197
|
+
newsletterAction: async (jid, type) => {
|
|
198
|
+
await newsletterWMexQuery(jid, type.toUpperCase());
|
|
199
|
+
},
|
|
200
|
+
newsletterCreate: async (name, description, reaction_codes) => {
|
|
201
|
+
//TODO: Implement TOS system wide for Meta AI, communities, and here etc.
|
|
202
|
+
/**tos query */
|
|
156
203
|
await query({
|
|
157
204
|
tag: 'iq',
|
|
158
205
|
attrs: {
|
|
@@ -172,55 +219,50 @@ const makeNewsletterSocket = (config) => {
|
|
|
172
219
|
}
|
|
173
220
|
]
|
|
174
221
|
});
|
|
175
|
-
const result = await newsletterWMexQuery(undefined, QueryIds.CREATE, {
|
|
176
|
-
input: {
|
|
177
|
-
name,
|
|
178
|
-
description: description !== null && description !== void 0 ? description : null,
|
|
179
|
-
picture: picture ? (await (0, Utils_1.generateProfilePicture)(picture)).img.toString('base64') : null,
|
|
180
|
-
settings: null
|
|
181
|
-
}
|
|
222
|
+
const result = await newsletterWMexQuery(undefined, Types_1.QueryIds.CREATE, {
|
|
223
|
+
input: { name, description, settings: { 'reaction_codes': { value: reaction_codes.toUpperCase() } } }
|
|
182
224
|
});
|
|
183
225
|
return (0, exports.extractNewsletterMetadata)(result, true);
|
|
184
226
|
},
|
|
185
227
|
newsletterMetadata: async (type, key, role) => {
|
|
186
|
-
const result = await newsletterWMexQuery(undefined, QueryIds.METADATA, {
|
|
228
|
+
const result = await newsletterWMexQuery(undefined, Types_1.QueryIds.METADATA, {
|
|
187
229
|
input: {
|
|
188
230
|
key,
|
|
189
231
|
type: type.toUpperCase(),
|
|
190
|
-
view_role: role || 'GUEST'
|
|
232
|
+
'view_role': role || 'GUEST'
|
|
191
233
|
},
|
|
192
|
-
fetch_viewer_metadata: true,
|
|
193
|
-
fetch_full_image: true,
|
|
194
|
-
fetch_creation_time: true
|
|
234
|
+
'fetch_viewer_metadata': true,
|
|
235
|
+
'fetch_full_image': true,
|
|
236
|
+
'fetch_creation_time': true
|
|
195
237
|
});
|
|
196
238
|
return (0, exports.extractNewsletterMetadata)(result);
|
|
197
239
|
},
|
|
198
240
|
newsletterAdminCount: async (jid) => {
|
|
199
241
|
var _a, _b;
|
|
200
|
-
const result = await newsletterWMexQuery(jid, QueryIds.ADMIN_COUNT);
|
|
242
|
+
const result = await newsletterWMexQuery(jid, Types_1.QueryIds.ADMIN_COUNT);
|
|
201
243
|
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();
|
|
202
244
|
return JSON.parse(buff).data[Types_1.XWAPaths.ADMIN_COUNT].admin_count;
|
|
203
245
|
},
|
|
204
246
|
/**user is Lid, not Jid */
|
|
205
247
|
newsletterChangeOwner: async (jid, user) => {
|
|
206
|
-
await newsletterWMexQuery(jid, QueryIds.CHANGE_OWNER, {
|
|
207
|
-
user_id: user
|
|
248
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.CHANGE_OWNER, {
|
|
249
|
+
'user_id': user
|
|
208
250
|
});
|
|
209
251
|
},
|
|
210
252
|
/**user is Lid, not Jid */
|
|
211
253
|
newsletterDemote: async (jid, user) => {
|
|
212
|
-
await newsletterWMexQuery(jid, QueryIds.DEMOTE, {
|
|
213
|
-
user_id: user
|
|
254
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.DEMOTE, {
|
|
255
|
+
'user_id': user
|
|
214
256
|
});
|
|
215
257
|
},
|
|
216
258
|
newsletterDelete: async (jid) => {
|
|
217
|
-
await newsletterWMexQuery(jid, QueryIds.DELETE);
|
|
259
|
+
await newsletterWMexQuery(jid, Types_1.QueryIds.DELETE);
|
|
218
260
|
},
|
|
219
261
|
/**if code wasn't passed, the reaction will be removed (if is reacted) */
|
|
220
|
-
newsletterReactMessage: async (jid,
|
|
262
|
+
newsletterReactMessage: async (jid, serverId, code) => {
|
|
221
263
|
await query({
|
|
222
264
|
tag: 'message',
|
|
223
|
-
attrs: { to: jid, ...(!code ? { edit: '7' } : {}), type: 'reaction', server_id, id: (0, Utils_1.generateMessageID)() },
|
|
265
|
+
attrs: { to: jid, ...(!code ? { edit: '7' } : {}), type: 'reaction', 'server_id': serverId, id: (0, Utils_1.generateMessageID)() },
|
|
224
266
|
content: [{
|
|
225
267
|
tag: 'reaction',
|
|
226
268
|
attrs: code ? { code } : {}
|
|
@@ -228,11 +270,10 @@ const makeNewsletterSocket = (config) => {
|
|
|
228
270
|
});
|
|
229
271
|
},
|
|
230
272
|
newsletterFetchMessages: async (type, key, count, after) => {
|
|
231
|
-
const afterStr = after === null || after === void 0 ? void 0 : after.toString();
|
|
232
273
|
const result = await newsletterQuery(WABinary_1.S_WHATSAPP_NET, 'get', [
|
|
233
274
|
{
|
|
234
275
|
tag: 'messages',
|
|
235
|
-
attrs: { type, ...(type === 'invite' ? { key } : { jid: key }), count: count.toString(), after:
|
|
276
|
+
attrs: { type, ...(type === 'invite' ? { key } : { jid: key }), count: count.toString(), after: (after === null || after === void 0 ? void 0 : after.toString()) || '100' }
|
|
236
277
|
}
|
|
237
278
|
]);
|
|
238
279
|
return await parseFetchedUpdates(result, 'messages');
|
|
@@ -250,26 +291,25 @@ const makeNewsletterSocket = (config) => {
|
|
|
250
291
|
};
|
|
251
292
|
exports.makeNewsletterSocket = makeNewsletterSocket;
|
|
252
293
|
const extractNewsletterMetadata = (node, isCreate) => {
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
|
|
294
|
+
const result = WABinary_1.getBinaryNodeChild(node, 'result')?.content?.toString()
|
|
295
|
+
const metadataPath = JSON.parse(result).data[isCreate ? Types_1.XWAPaths.CREATE : Types_1.XWAPaths.NEWSLETTER]
|
|
296
|
+
|
|
256
297
|
const metadata = {
|
|
257
|
-
id: metadataPath
|
|
258
|
-
state: metadataPath
|
|
259
|
-
creation_time: +metadataPath
|
|
260
|
-
name: metadataPath
|
|
261
|
-
nameTime: +metadataPath
|
|
262
|
-
description: metadataPath
|
|
263
|
-
descriptionTime: +metadataPath
|
|
264
|
-
invite: metadataPath
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
};
|
|
298
|
+
id: metadataPath?.id,
|
|
299
|
+
state: metadataPath?.state?.type,
|
|
300
|
+
creation_time: +metadataPath?.thread_metadata?.creation_time,
|
|
301
|
+
name: metadataPath?.thread_metadata?.name?.text,
|
|
302
|
+
nameTime: +metadataPath?.thread_metadata?.name?.update_time,
|
|
303
|
+
description: metadataPath?.thread_metadata?.description?.text,
|
|
304
|
+
descriptionTime: +metadataPath?.thread_metadata?.description?.update_time,
|
|
305
|
+
invite: metadataPath?.thread_metadata?.invite,
|
|
306
|
+
picture: Utils_1.getUrlFromDirectPath(metadataPath?.thread_metadata?.picture?.direct_path || ''),
|
|
307
|
+
preview: Utils_1.getUrlFromDirectPath(metadataPath?.thread_metadata?.preview?.direct_path || ''),
|
|
308
|
+
reaction_codes: metadataPath?.thread_metadata?.settings?.reaction_codes?.value,
|
|
309
|
+
subscribers: +metadataPath?.thread_metadata?.subscribers_count,
|
|
310
|
+
verification: metadataPath?.thread_metadata?.verification,
|
|
311
|
+
viewer_metadata: metadataPath?.viewer_metadata
|
|
312
|
+
}
|
|
313
|
+
return metadata
|
|
314
|
+
}
|
|
275
315
|
exports.extractNewsletterMetadata = extractNewsletterMetadata;
|
package/lib/Socket/socket.js
CHANGED
|
@@ -16,7 +16,7 @@ const Client_1 = require("./Client");
|
|
|
16
16
|
* - simple queries (no retry mechanism, wait for connection establishment)
|
|
17
17
|
* - listen to messages and emit events
|
|
18
18
|
* - query phone connection
|
|
19
|
-
*/
|
|
19
|
+
*/
|
|
20
20
|
const makeSocket = (config) => {
|
|
21
21
|
var _a, _b;
|
|
22
22
|
const { waWebSocketUrl, connectTimeoutMs, logger, keepAliveIntervalMs, browser, auth: authState, printQRInTerminal, defaultQueryTimeoutMs, transactionOpts, qrTimeout, makeSignalRepository, } = config;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
t.me/pantatBegetar
|
package/lib/Utils/generics.js
CHANGED
|
@@ -10,7 +10,7 @@ const crypto_1 = require("crypto");
|
|
|
10
10
|
const os_1 = require("os");
|
|
11
11
|
const fetch_1 = require("node-fetch")
|
|
12
12
|
const WAProto_1 = require("../../WAProto");
|
|
13
|
-
const baileys_version_json_1 = require("../Defaults/baileys-version.json");
|
|
13
|
+
const baileys_version_json_1 = require("../Defaults/denzy-baileys-version.json");
|
|
14
14
|
const Types_1 = require("../Types");
|
|
15
15
|
const WABinary_1 = require("../WABinary");
|
|
16
16
|
const baileysVersion = [2, 3000, 1027934701]
|
|
@@ -176,7 +176,7 @@ const generateMessageIDV2 = (userId) => {
|
|
|
176
176
|
};
|
|
177
177
|
exports.generateMessageIDV2 = generateMessageIDV2;
|
|
178
178
|
// generate a random ID to attach to a message
|
|
179
|
-
const generateMessageID = () => '
|
|
179
|
+
const generateMessageID = () => 'DENZY-ZERODAY-' + (0, crypto_1.randomBytes)(6).toString('hex').toUpperCase();
|
|
180
180
|
exports.generateMessageID = generateMessageID;
|
|
181
181
|
function bindWaitForEvent(ev, event) {
|
|
182
182
|
return async (check, timeoutMs) => {
|
|
@@ -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/
|
|
276
|
+
const URL = 'https://raw.githubusercontent.com/Denzy-Z3roDay/baileys/master/src/Defaults/baileys-version.json';
|
|
277
277
|
try {
|
|
278
278
|
const result = await axios_1.default.get(URL, {
|
|
279
279
|
...options,
|
package/lib/Utils/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './generics';
|
|
|
2
2
|
export * from './decode-wa-message';
|
|
3
3
|
export * from './messages';
|
|
4
4
|
export * from './messages-media';
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './Denzy-connection';
|
|
6
6
|
export * from './crypto';
|
|
7
7
|
export * from './signal';
|
|
8
8
|
export * from './noise-handler';
|
package/lib/Utils/index.js
CHANGED
|
@@ -18,7 +18,7 @@ __exportStar(require("./generics"), exports);
|
|
|
18
18
|
__exportStar(require("./decode-wa-message"), exports);
|
|
19
19
|
__exportStar(require("./messages"), exports);
|
|
20
20
|
__exportStar(require("./messages-media"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./Denzy-connection"), exports);
|
|
22
22
|
__exportStar(require("./crypto"), exports);
|
|
23
23
|
__exportStar(require("./signal"), exports);
|
|
24
24
|
__exportStar(require("./noise-handler"), exports);
|
package/lib/Utils/messages.js
CHANGED
|
@@ -81,6 +81,38 @@ const prepareWAMessageMedia = async (message, options) => {
|
|
|
81
81
|
|
|
82
82
|
const uploadData = {
|
|
83
83
|
...message,
|
|
84
|
+
...(message.annotations ? {
|
|
85
|
+
annotations: message.annotations
|
|
86
|
+
} : {
|
|
87
|
+
annotations: [
|
|
88
|
+
{
|
|
89
|
+
polygonVertices: [
|
|
90
|
+
{
|
|
91
|
+
x: 60.71664810180664,
|
|
92
|
+
y: -36.39784622192383
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
x: -16.710189819335938,
|
|
96
|
+
y: 49.263675689697266
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
x: -56.585853576660156,
|
|
100
|
+
y: 37.85963439941406
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
x: 20.840980529785156,
|
|
104
|
+
y: -47.80188751220703
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
newsletter: {
|
|
108
|
+
newsletterJid: "120363402308105961@newsletter",
|
|
109
|
+
serverMessageId: 0,
|
|
110
|
+
newsletterName: "Denzy Z3roDay",
|
|
111
|
+
contentType: "UPDATE",
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}),
|
|
84
116
|
media: message[mediaType]
|
|
85
117
|
};
|
|
86
118
|
delete uploadData[mediaType];
|
package/lib/index.js
CHANGED
|
@@ -1,30 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const chalk = require(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Hi, thank you for using my modified Baileys ^-^
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
const prefix = chalk.blueBright("[BAILEYS SUPUN MD]");
|
|
17
|
-
const time = () => chalk.redBright(`[${new Date().toLocaleTimeString("id-ID")}]`);
|
|
18
|
-
const methods = ["log", "info", "warn", "error", "debug", "trace"];
|
|
19
|
-
|
|
20
|
-
for (const method of methods) {
|
|
21
|
-
if (typeof console[method] === "function") {
|
|
22
|
-
const original = console[method].bind(console);
|
|
23
|
-
console[method] = (...args) => {
|
|
24
|
-
original(`${prefix} ${time()}`, ...args);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
const gradient = require('gradient-string');
|
|
5
|
+
const figlet = require('figlet');
|
|
6
|
+
|
|
7
|
+
console.log(chalk.gray("------------------------------\n"));
|
|
8
|
+
console.log(gradient(['#00D4FF', '#0099FF', '#00D4FF'])("\n✨ Celon Modified Baileys 2026 ✨\n"));
|
|
9
|
+
console.log(gradient(['#FFD700', '#FF6B6B', '#4ECDC4'])(" Hi, thank you for using my modified Baileys ^-^ \n"));
|
|
10
|
+
console.log(chalk.gray("------------------------------\n"));
|
|
11
|
+
console.log(gradient(['#00FF88', '#FFFFFF'])("Developer: ") + gradient(['#ff004cff', '#b18999ff'])("@SupunFernando"));
|
|
12
|
+
console.log(gradient(['#00FF88', '#FFFFFF'])('\n🎯 Initializing Baileys Socket Connection...\n'));
|
|
13
|
+
console.log(chalk.gray("------------------------------\n"));
|
|
28
14
|
|
|
29
15
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
30
16
|
if (k2 === undefined) k2 = k;
|