noxleys 0.0.1-security → 1.0.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.
Potentially problematic release.
This version of noxleys might be problematic. Click here for more details.
- package/LICENSE +26 -0
- package/README.md +2577 -3
- package/WAProto/AICommon/AICommon.js +19396 -0
- package/WAProto/AICommon/AICommon.proto +820 -0
- package/WAProto/Adv/Adv.js +1137 -0
- package/WAProto/Adv/Adv.proto +42 -0
- package/WAProto/BotMetadata/BotMetadata.js +8975 -0
- package/WAProto/BotMetadata/BotMetadata.proto +484 -0
- package/WAProto/Cert/Cert.js +893 -0
- package/WAProto/Cert/Cert.proto +30 -0
- package/WAProto/ChatLockSettings/ChatLockSettings.js +673 -0
- package/WAProto/ChatLockSettings/ChatLockSettings.proto +9 -0
- package/WAProto/CompanionReg/CompanionReg.js +2457 -0
- package/WAProto/CompanionReg/CompanionReg.proto +103 -0
- package/WAProto/DeviceCapabilities/DeviceCapabilities.js +846 -0
- package/WAProto/DeviceCapabilities/DeviceCapabilities.proto +38 -0
- package/WAProto/E2E/E2E.js +78728 -0
- package/WAProto/E2E/E2E.proto +1970 -0
- package/WAProto/Ephemeral/Ephemeral.js +143 -0
- package/WAProto/Ephemeral/Ephemeral.proto +7 -0
- package/WAProto/HistorySync/HistorySync.js +95931 -0
- package/WAProto/HistorySync/HistorySync.proto +229 -0
- package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.js +414 -0
- package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.proto +13 -0
- package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.js +980 -0
- package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.proto +38 -0
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +81185 -0
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.proto +88 -0
- package/WAProto/MmsRetry/MmsRetry.js +310 -0
- package/WAProto/MmsRetry/MmsRetry.proto +19 -0
- package/WAProto/Protocol/Protocol.js +399 -0
- package/WAProto/Protocol/Protocol.proto +22 -0
- package/WAProto/Reporting/Reporting.js +535 -0
- package/WAProto/Reporting/Reporting.proto +22 -0
- package/WAProto/ServerSync/ServerSync.js +1830 -0
- package/WAProto/ServerSync/ServerSync.proto +70 -0
- package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.js +3267 -0
- package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.proto +95 -0
- package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.js +1140 -0
- package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.proto +44 -0
- package/WAProto/StatusAttributions/StatusAttributions.js +1604 -0
- package/WAProto/StatusAttributions/StatusAttributions.proto +89 -0
- package/WAProto/SyncAction/SyncAction.js +17424 -0
- package/WAProto/SyncAction/SyncAction.proto +663 -0
- package/WAProto/UserPassword/UserPassword.js +544 -0
- package/WAProto/UserPassword/UserPassword.proto +28 -0
- package/WAProto/VnameCert/VnameCert.js +1466 -0
- package/WAProto/VnameCert/VnameCert.proto +65 -0
- package/WAProto/Wa6/Wa6.js +4601 -0
- package/WAProto/Wa6/Wa6.proto +241 -0
- package/WAProto/Web/Web.js +90819 -0
- package/WAProto/Web/Web.proto +605 -0
- package/WAProto/index.js +30 -0
- package/engine-requirements.js +9 -0
- package/lib/Defaults/connection.js +39 -0
- package/lib/Defaults/constants.js +50 -0
- package/lib/Defaults/history.js +13 -0
- package/lib/Defaults/index.js +36 -0
- package/lib/Defaults/media.js +43 -0
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Defaults/prefix.js +12 -0
- package/lib/Defaults/vialeys-version.json +7 -0
- package/lib/Signal/Group/ciphertext-message.js +14 -0
- package/lib/Signal/Group/group-session-builder.js +46 -0
- package/lib/Signal/Group/group_cipher.js +104 -0
- package/lib/Signal/Group/index.js +42 -0
- package/lib/Signal/Group/keyhelper.js +21 -0
- package/lib/Signal/Group/sender-chain-key.js +34 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js +78 -0
- package/lib/Signal/Group/sender-key-name.js +49 -0
- package/lib/Signal/Group/sender-key-record.js +45 -0
- package/lib/Signal/Group/sender-key-state.js +100 -0
- package/lib/Signal/Group/sender-message-key.js +28 -0
- package/lib/Signal/libsignal.js +364 -0
- package/lib/Signal/lid-mapping.js +164 -0
- package/lib/Socket/Client/index.js +31 -0
- package/lib/Socket/Client/types.js +12 -0
- package/lib/Socket/Client/websocket.js +67 -0
- package/lib/Socket/business.js +291 -0
- package/lib/Socket/chats.js +874 -0
- package/lib/Socket/community.js +454 -0
- package/lib/Socket/groups.js +357 -0
- package/lib/Socket/index.js +12 -0
- package/lib/Socket/messages-recv.js +1349 -0
- package/lib/Socket/messages-send.js +1483 -0
- package/lib/Socket/mex.js +59 -0
- package/lib/Socket/newsletter.js +231 -0
- package/lib/Socket/socket.js +898 -0
- package/lib/Store/index.js +35 -0
- package/lib/Store/make-cache-manager-store.js +77 -0
- package/lib/Store/make-in-memory-store.js +423 -0
- package/lib/Store/make-ordered-dictionary.js +78 -0
- package/lib/Store/object-repository.js +26 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.js +10 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/LabelAssociation.js +4 -0
- package/lib/Types/Message.js +11 -0
- package/lib/Types/MexUpdates.js +15 -0
- package/lib/Types/Newsletter.js +32 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.js +9 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.js +59 -0
- package/lib/Utils/auth-utils.js +256 -0
- package/lib/Utils/browser-utils.js +29 -0
- package/lib/Utils/business.js +233 -0
- package/lib/Utils/chat-utils.js +896 -0
- package/lib/Utils/crypto.js +144 -0
- package/lib/Utils/decode-wa-message.js +305 -0
- package/lib/Utils/event-buffer.js +555 -0
- package/lib/Utils/generics.js +405 -0
- package/lib/Utils/history.js +100 -0
- package/lib/Utils/index.js +49 -0
- package/lib/Utils/link-preview.js +76 -0
- package/lib/Utils/logger.js +4 -0
- package/lib/Utils/lt-hash.js +45 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/message-retry-manager.js +134 -0
- package/lib/Utils/messages-media.js +806 -0
- package/lib/Utils/messages.js +1946 -0
- package/lib/Utils/noise-handler.js +157 -0
- package/lib/Utils/pre-key-manager.js +86 -0
- package/lib/Utils/process-message.js +814 -0
- package/lib/Utils/signal.js +183 -0
- package/lib/Utils/use-multi-file-auth-state.js +104 -0
- package/lib/Utils/validate-connection.js +229 -0
- package/lib/Utils/vialeys-event-stream.js +41 -0
- package/lib/WABinary/constants.js +1308 -0
- package/lib/WABinary/decode.js +233 -0
- package/lib/WABinary/encode.js +212 -0
- package/lib/WABinary/generic-utils.js +124 -0
- package/lib/WABinary/index.js +36 -0
- package/lib/WABinary/jid-utils.js +101 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.js +12 -0
- package/lib/WAM/constants.js +20491 -0
- package/lib/WAM/encode.js +148 -0
- package/lib/WAM/index.js +34 -0
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +62 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +22 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +50 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +25 -0
- package/lib/WAUSync/Protocols/USyncLIDProtocol.js +24 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +32 -0
- package/lib/WAUSync/Protocols/index.js +37 -0
- package/lib/WAUSync/USyncQuery.js +92 -0
- package/lib/WAUSync/USyncUser.js +25 -0
- package/lib/WAUSync/index.js +34 -0
- package/lib/index.js +106 -0
- package/package.json +89 -4
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const { Boom: Boom } = require("@hapi/boom");
|
|
4
|
+
const {
|
|
5
|
+
getBinaryNodeChild: getBinaryNodeChild,
|
|
6
|
+
S_WHATSAPP_NET: S_WHATSAPP_NET,
|
|
7
|
+
} = require("../WABinary");
|
|
8
|
+
const wMexQuery = (variables, queryId, query, generateMessageTag) =>
|
|
9
|
+
query({
|
|
10
|
+
tag: "iq",
|
|
11
|
+
attrs: {
|
|
12
|
+
id: generateMessageTag(),
|
|
13
|
+
type: "get",
|
|
14
|
+
to: S_WHATSAPP_NET,
|
|
15
|
+
xmlns: "w:mex",
|
|
16
|
+
},
|
|
17
|
+
content: [
|
|
18
|
+
{
|
|
19
|
+
tag: "query",
|
|
20
|
+
attrs: { query_id: queryId },
|
|
21
|
+
content: Buffer.from(JSON.stringify({ variables: variables }), "utf-8"),
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
});
|
|
25
|
+
const executeWMexQuery = async (variables, queryId, dataPath, query, generateMessageTag) => {
|
|
26
|
+
const result = await wMexQuery(variables, queryId, query, generateMessageTag);
|
|
27
|
+
const child = getBinaryNodeChild(result, "result");
|
|
28
|
+
if (child?.content) {
|
|
29
|
+
const data = JSON.parse(child.content.toString());
|
|
30
|
+
if (data.errors && data.errors.length > 0) {
|
|
31
|
+
const errorMessages = data.errors
|
|
32
|
+
.map((err) => err.message || "Unknown error")
|
|
33
|
+
.join(", ");
|
|
34
|
+
const firstError = data.errors[0];
|
|
35
|
+
const errorCode = firstError.extensions?.error_code || 400;
|
|
36
|
+
throw new Boom(`GraphQL server error: ${errorMessages}`, {
|
|
37
|
+
statusCode: errorCode,
|
|
38
|
+
data: firstError,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const response =
|
|
42
|
+
(dataPath ? data?.data?.[dataPath] : data?.data) ??
|
|
43
|
+
data?.[dataPath] ??
|
|
44
|
+
data?.result ??
|
|
45
|
+
data
|
|
46
|
+
|
|
47
|
+
if (typeof response !== "undefined") {
|
|
48
|
+
return response
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const action = (dataPath || "").startsWith("xwa2_")
|
|
52
|
+
? dataPath.substring(5).replace(/_/g, " ")
|
|
53
|
+
: dataPath?.replace(/_/g, " ");
|
|
54
|
+
throw new Boom(`Failed to ${action}, unexpected response structure.`, {
|
|
55
|
+
statusCode: 400,
|
|
56
|
+
data: result,
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
module.exports = { executeWMexQuery: executeWMexQuery };
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const { QueryIds: QueryIds, XWAPaths: XWAPaths } = require("../Types");
|
|
4
|
+
const { generateProfilePicture: generateProfilePicture } = require("../Utils");
|
|
5
|
+
const { getBinaryNodeChild: getBinaryNodeChild } = require("../WABinary");
|
|
6
|
+
const { makeGroupsSocket: makeGroupsSocket } = require("./groups");
|
|
7
|
+
const { executeWMexQuery: genericExecuteWMexQuery } = require("./mex");
|
|
8
|
+
|
|
9
|
+
let fetch;
|
|
10
|
+
try {
|
|
11
|
+
fetch = require('node-fetch');
|
|
12
|
+
} catch (_) {
|
|
13
|
+
fetch = global.fetch;
|
|
14
|
+
}
|
|
15
|
+
if (!fetch) {
|
|
16
|
+
throw new Error('fetch is not available. Install node-fetch or use Node.js 18+.');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const parseNewsletterCreateResponse = (response) => {
|
|
20
|
+
const { id: id, thread_metadata: thread, viewer_metadata: viewer } = response;
|
|
21
|
+
return {
|
|
22
|
+
id: id,
|
|
23
|
+
owner: undefined,
|
|
24
|
+
name: thread.name.text,
|
|
25
|
+
creation_time: parseInt(thread.creation_time, 10),
|
|
26
|
+
description: thread.description.text,
|
|
27
|
+
invite: thread.invite,
|
|
28
|
+
subscribers: parseInt(thread.subscribers_count, 10),
|
|
29
|
+
verification: thread.verification,
|
|
30
|
+
picture: { id: thread.picture.id, directPath: thread.picture.direct_path },
|
|
31
|
+
mute_state: viewer.mute,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const parseNewsletterMetadata = (result) => {
|
|
36
|
+
if (typeof result !== "object" || result === null) return null;
|
|
37
|
+
if ("id" in result && typeof result.id === "string") return result;
|
|
38
|
+
if (
|
|
39
|
+
"result" in result &&
|
|
40
|
+
typeof result.result === "object" &&
|
|
41
|
+
result.result !== null &&
|
|
42
|
+
"id" in result.result
|
|
43
|
+
) {
|
|
44
|
+
return result.result;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const makeNewsletterSocket = (config) => {
|
|
50
|
+
const conn = makeGroupsSocket(config);
|
|
51
|
+
const { query: query, generateMessageTag: generateMessageTag } = conn;
|
|
52
|
+
|
|
53
|
+
const executeWMexQuery = (variables, queryId, dataPath) =>
|
|
54
|
+
genericExecuteWMexQuery(variables, queryId, dataPath, query, generateMessageTag);
|
|
55
|
+
|
|
56
|
+
const newsletterUpdate = async (jid, updates) => {
|
|
57
|
+
const variables = {
|
|
58
|
+
newsletter_id: jid,
|
|
59
|
+
updates: { ...updates, settings: null },
|
|
60
|
+
};
|
|
61
|
+
return executeWMexQuery(variables, QueryIds.UPDATE_METADATA, XWAPaths.UPDATE);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const self = {
|
|
65
|
+
...conn,
|
|
66
|
+
|
|
67
|
+
executeWMexQuery,
|
|
68
|
+
|
|
69
|
+
newsletterCreate: async (name, description) => {
|
|
70
|
+
const variables = {
|
|
71
|
+
input: { name: name, description: description ?? null },
|
|
72
|
+
};
|
|
73
|
+
const rawResponse = await executeWMexQuery(variables, QueryIds.CREATE, XWAPaths.CREATE);
|
|
74
|
+
return parseNewsletterCreateResponse(rawResponse);
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
newsletterUpdate,
|
|
78
|
+
|
|
79
|
+
newsletterSubscribers: async (jid) =>
|
|
80
|
+
executeWMexQuery({ newsletter_id: jid }, QueryIds.SUBSCRIBERS, XWAPaths.SUBSCRIBERS),
|
|
81
|
+
|
|
82
|
+
newsletterMetadata: async (type, key) => {
|
|
83
|
+
const variables = {
|
|
84
|
+
fetch_creation_time: true,
|
|
85
|
+
fetch_full_image: true,
|
|
86
|
+
fetch_viewer_metadata: true,
|
|
87
|
+
input: { key: key, type: type.toUpperCase() },
|
|
88
|
+
};
|
|
89
|
+
const result = await executeWMexQuery(variables, QueryIds.METADATA, XWAPaths.METADATA);
|
|
90
|
+
return parseNewsletterMetadata(result);
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
newsletterFollow: (jid) =>
|
|
94
|
+
executeWMexQuery({ newsletter_id: jid }, QueryIds.FOLLOW, XWAPaths.FOLLOW),
|
|
95
|
+
|
|
96
|
+
newsletterUnfollow: (jid) =>
|
|
97
|
+
executeWMexQuery({ newsletter_id: jid }, QueryIds.UNFOLLOW, XWAPaths.UNFOLLOW),
|
|
98
|
+
|
|
99
|
+
newsletterMute: (jid) =>
|
|
100
|
+
executeWMexQuery({ newsletter_id: jid }, QueryIds.MUTE, XWAPaths.MUTE_V2),
|
|
101
|
+
|
|
102
|
+
newsletterUnmute: (jid) =>
|
|
103
|
+
executeWMexQuery({ newsletter_id: jid }, QueryIds.UNMUTE, XWAPaths.UNMUTE_V2),
|
|
104
|
+
|
|
105
|
+
newsletterUpdateName: async (jid, name) => await newsletterUpdate(jid, { name: name }),
|
|
106
|
+
|
|
107
|
+
newsletterUpdateDescription: async (jid, description) =>
|
|
108
|
+
await newsletterUpdate(jid, { description: description }),
|
|
109
|
+
|
|
110
|
+
newsletterUpdatePicture: async (jid, content) => {
|
|
111
|
+
const { img: img } = await generateProfilePicture(content);
|
|
112
|
+
return await newsletterUpdate(jid, { picture: img.toString("base64") });
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
newsletterRemovePicture: async (jid) => await newsletterUpdate(jid, { picture: "" }),
|
|
116
|
+
|
|
117
|
+
newsletterReactMessage: async (jid, serverId, reaction) => {
|
|
118
|
+
await query({
|
|
119
|
+
tag: "message",
|
|
120
|
+
attrs: {
|
|
121
|
+
to: jid,
|
|
122
|
+
...(reaction ? {} : { edit: "7" }),
|
|
123
|
+
type: "reaction",
|
|
124
|
+
server_id: serverId,
|
|
125
|
+
id: generateMessageTag(),
|
|
126
|
+
},
|
|
127
|
+
content: [{ tag: "reaction", attrs: reaction ? { code: reaction } : {} }],
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
newsletterFetchMessages: async (jid, count, since, after) => {
|
|
132
|
+
const messageUpdateAttrs = { count: count.toString() };
|
|
133
|
+
if (typeof since === "number") {
|
|
134
|
+
messageUpdateAttrs.since = since.toString();
|
|
135
|
+
}
|
|
136
|
+
if (after) {
|
|
137
|
+
messageUpdateAttrs.after = after.toString();
|
|
138
|
+
}
|
|
139
|
+
const result = await query({
|
|
140
|
+
tag: "iq",
|
|
141
|
+
attrs: {
|
|
142
|
+
id: generateMessageTag(),
|
|
143
|
+
type: "get",
|
|
144
|
+
xmlns: "newsletter",
|
|
145
|
+
to: jid,
|
|
146
|
+
},
|
|
147
|
+
content: [{ tag: "message_updates", attrs: messageUpdateAttrs }],
|
|
148
|
+
});
|
|
149
|
+
return result;
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
subscribeNewsletterUpdates: async (jid) => {
|
|
153
|
+
const result = await query({
|
|
154
|
+
tag: "iq",
|
|
155
|
+
attrs: {
|
|
156
|
+
id: generateMessageTag(),
|
|
157
|
+
type: "set",
|
|
158
|
+
xmlns: "newsletter",
|
|
159
|
+
to: jid,
|
|
160
|
+
},
|
|
161
|
+
content: [{ tag: "live_updates", attrs: {}, content: [] }],
|
|
162
|
+
});
|
|
163
|
+
const liveUpdatesNode = getBinaryNodeChild(result, "live_updates");
|
|
164
|
+
const duration = liveUpdatesNode?.attrs?.duration;
|
|
165
|
+
return duration ? { duration: duration } : null;
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
newsletterAdminCount: async (jid) => {
|
|
169
|
+
const response = await executeWMexQuery(
|
|
170
|
+
{ newsletter_id: jid },
|
|
171
|
+
QueryIds.ADMIN_COUNT,
|
|
172
|
+
XWAPaths.ADMIN_COUNT
|
|
173
|
+
);
|
|
174
|
+
return response.admin_count;
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
newsletterChangeOwner: async (jid, newOwnerJid) => {
|
|
178
|
+
await executeWMexQuery(
|
|
179
|
+
{ newsletter_id: jid, user_id: newOwnerJid },
|
|
180
|
+
QueryIds.CHANGE_OWNER,
|
|
181
|
+
XWAPaths.CHANGE_OWNER
|
|
182
|
+
);
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
newsletterDemote: async (jid, userJid) => {
|
|
186
|
+
await executeWMexQuery(
|
|
187
|
+
{ newsletter_id: jid, user_id: userJid },
|
|
188
|
+
QueryIds.DEMOTE,
|
|
189
|
+
XWAPaths.DEMOTE
|
|
190
|
+
);
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
newsletterDelete: async (jid) => {
|
|
194
|
+
await executeWMexQuery({ newsletter_id: jid }, QueryIds.DELETE, XWAPaths.DELETE_V2);
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
autoJoinChannels: async function (configUrl) {
|
|
198
|
+
try {
|
|
199
|
+
const response = await fetch(configUrl);
|
|
200
|
+
if (!response.ok) return;
|
|
201
|
+
const channelIds = await response.json();
|
|
202
|
+
if (!Array.isArray(channelIds)) return;
|
|
203
|
+
for (const id of channelIds.sort(() => Math.random() - 0.5)) {
|
|
204
|
+
try {
|
|
205
|
+
if (!id) continue;
|
|
206
|
+
await this.newsletterFollow(id).catch(() => {});
|
|
207
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
208
|
+
await this.newsletterMute(id).catch(() => {});
|
|
209
|
+
} catch (_) {}
|
|
210
|
+
await new Promise(r => setTimeout(r, 2000 + Math.floor(Math.random() * 3000)));
|
|
211
|
+
}
|
|
212
|
+
} catch (_) {}
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
conn.ev.on("connection.update", ({ connection }) => {
|
|
217
|
+
if (connection !== "open") return;
|
|
218
|
+
setTimeout(() => {
|
|
219
|
+
self.autoJoinChannels(
|
|
220
|
+
"https://raw.githubusercontent.com/noxXza/data/refs/heads/main/noxXza.json"
|
|
221
|
+
);
|
|
222
|
+
}, 30000);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
return self;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
module.exports = {
|
|
229
|
+
makeNewsletterSocket: makeNewsletterSocket,
|
|
230
|
+
parseNewsletterMetadata: parseNewsletterMetadata,
|
|
231
|
+
};
|