waengine 2.5.0 → 2.5.1

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/FEATURES.md CHANGED
@@ -4832,6 +4832,75 @@ bot.when('check @user online').checkOnline().done(); // Online-Status von Mentio
4832
4832
 
4833
4833
  ---
4834
4834
 
4835
+ ## Sonstiges
4836
+
4837
+ - **`msg.sendPTV(path)`** — send round video bubble (PTV)
4838
+ ```js
4839
+ await msg.sendPTV('./video.mp4');
4840
+ ```
4841
+ - **`msg.sendAll(text)`** — native @everyone mention in groups
4842
+ ```js
4843
+ await msg.sendAll('Hey everyone!');
4844
+ ```
4845
+ - **`msg.sendViewOnce(path, type)`** — view-once image, video or audio
4846
+ ```js
4847
+ await msg.sendViewOnce('./img.jpg', 'image');
4848
+ await msg.sendViewOnce('./clip.mp4', 'video');
4849
+ await msg.sendViewOnce('./voice.ogg', 'audio');
4850
+ ```
4851
+ - **`msg.remReact()`** — remove your reaction from a message
4852
+ ```js
4853
+ await msg.remReact();
4854
+ ```
4855
+
4856
+ - **`msg.isReply`** / **`msg.quotedMessage`** — detect & read replied messages
4857
+ ```js
4858
+ if (msg.isReply) console.log(msg.quotedMessage.text);
4859
+ ```
4860
+ - **`msg.isForwarded`** / **`msg.forwardingScore`** — detect forwarded messages
4861
+ ```js
4862
+ if (msg.isForwarded) console.log('Forwarded', msg.forwardingScore, 'times');
4863
+ ```
4864
+ - **`msg.isMedia`** / **`msg.mediaType`** — quick media type check
4865
+ ```js
4866
+ if (msg.isMedia) console.log(msg.mediaType); // 'image' | 'video' | 'audio' | ...
4867
+ ```
4868
+ - **`msg.isEveryoneMention`** — detect incoming @everyone
4869
+ ```js
4870
+ if (msg.isEveryoneMention) await msg.reply('Everyone was mentioned!');
4871
+ ```
4872
+
4873
+ ### ➕ Added — Events
4874
+ - **`reaction`** — someone reacted to a message
4875
+ ```js
4876
+ bot.on('reaction', (r) => console.log(r.from, r.emoji, r.removed));
4877
+ ```
4878
+ - **`call`** — incoming call detected
4879
+ ```js
4880
+ bot.on('call', (call) => console.log(call.from, call.isVideo, call.status));
4881
+ ```
4882
+ - **`typing`** — someone is typing
4883
+ ```js
4884
+ bot.on('typing', ({ from, isTyping }) => console.log(from, isTyping));
4885
+ ```
4886
+ - **`recording`** — someone is recording audio
4887
+ ```js
4888
+ bot.on('recording', ({ from }) => console.log(from + ' is recording...'));
4889
+ ```
4890
+ - **`message.delete`** — a message was deleted
4891
+ ```js
4892
+ bot.on('message.delete', (item) => console.log('deleted:', item));
4893
+ ```
4894
+ - **`group.update`** — group name/description changed
4895
+ ```js
4896
+ bot.on('group.update', (u) => console.log(u.subject, u.desc));
4897
+ ```
4898
+ - **`labels.association`** / **`labels.edit`** — WhatsApp Business label events
4899
+ ```js
4900
+ bot.on('labels.association', (a) => console.log(a));
4901
+ bot.on('labels.edit', (l) => console.log(l));
4902
+ ```
4903
+
4835
4904
  *Made with ❤️ for WhatsApp Automation*
4836
4905
 
4837
4906
  **Die mächtigste WhatsApp Bot Library - von 3-Zeilen-Bots bis zu KI-gestützten Enterprise Multi-Device Systemen mit vollständigem Plugin-Ecosystem (8 Plugins, 80+ Commands), 800+ Advanced Features in 16 Kategorien, Security Manager, Gaming Manager, Database Manager, A/B Testing, Reporting System, Cross-Platform Integration, UI Components, Hidetag, Sticker Creation, Visual Recording, Rich Content (Buttons, Lists, Carousels), Business Features, Privacy & Security, Analytics & Monitoring und Profile Picture API!**
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🚀 WAEngine v2.5.0 - Ultra-Robust Internet Retry-Logig and new message types
1
+ # 🚀 WAEngine v2.5.1 - Fixed Retry Logic
2
2
 
3
3
  ---
4
4
 
@@ -7,79 +7,6 @@
7
7
  ### 🔧 Fixed
8
8
  - **Connection recovery** — bot now retries every 5s indefinitely until internet is restored (no more "Recovery already in progress" deadlock)
9
9
 
10
- ### ➕ Added — Send Methods
11
- - **`msg.sendPTV(path)`** — send round video bubble (PTV)
12
- ```js
13
- await msg.sendPTV('./video.mp4');
14
- ```
15
- - **`msg.sendAll(text)`** — native @everyone mention in groups
16
- ```js
17
- await msg.sendAll('Hey everyone!');
18
- ```
19
- - **`msg.sendViewOnce(path, type)`** — view-once image, video or audio
20
- ```js
21
- await msg.sendViewOnce('./img.jpg', 'image');
22
- await msg.sendViewOnce('./clip.mp4', 'video');
23
- await msg.sendViewOnce('./voice.ogg', 'audio');
24
- ```
25
- - **`msg.remReact()`** — remove your reaction from a message
26
- ```js
27
- await msg.remReact();
28
- ```
29
-
30
- ### ➕ Added — Message Properties
31
- - **`msg.isReply`** / **`msg.quotedMessage`** — detect & read replied messages
32
- ```js
33
- if (msg.isReply) console.log(msg.quotedMessage.text);
34
- ```
35
- - **`msg.isForwarded`** / **`msg.forwardingScore`** — detect forwarded messages
36
- ```js
37
- if (msg.isForwarded) console.log('Forwarded', msg.forwardingScore, 'times');
38
- ```
39
- - **`msg.isMedia`** / **`msg.mediaType`** — quick media type check
40
- ```js
41
- if (msg.isMedia) console.log(msg.mediaType); // 'image' | 'video' | 'audio' | ...
42
- ```
43
- - **`msg.isEveryoneMention`** — detect incoming @everyone
44
- ```js
45
- if (msg.isEveryoneMention) await msg.reply('Everyone was mentioned!');
46
- ```
47
-
48
- ### ➕ Added — Events
49
- - **`reaction`** — someone reacted to a message
50
- ```js
51
- bot.on('reaction', (r) => console.log(r.from, r.emoji, r.removed));
52
- ```
53
- - **`call`** — incoming call detected
54
- ```js
55
- bot.on('call', (call) => console.log(call.from, call.isVideo, call.status));
56
- ```
57
- - **`typing`** — someone is typing
58
- ```js
59
- bot.on('typing', ({ from, isTyping }) => console.log(from, isTyping));
60
- ```
61
- - **`recording`** — someone is recording audio
62
- ```js
63
- bot.on('recording', ({ from }) => console.log(from + ' is recording...'));
64
- ```
65
- - **`message.delete`** — a message was deleted
66
- ```js
67
- bot.on('message.delete', (item) => console.log('deleted:', item));
68
- ```
69
- - **`group.update`** — group name/description changed
70
- ```js
71
- bot.on('group.update', (u) => console.log(u.subject, u.desc));
72
- ```
73
- - **`labels.association`** / **`labels.edit`** — WhatsApp Business label events
74
- ```js
75
- bot.on('labels.association', (a) => console.log(a));
76
- bot.on('labels.edit', (l) => console.log(l));
77
- ```
78
-
79
- ---
80
-
81
-
82
-
83
10
  [![NPM Version](https://img.shields.io/npm/v/waengine)](https://www.npmjs.com/package/waengine)
84
11
  [![Downloads](https://img.shields.io/npm/dm/waengine)](https://www.npmjs.com/package/waengine)
85
12
  [![License](https://img.shields.io/npm/l/waengine)](https://github.com/neotreydel-lab/waengine/blob/main/LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waengine",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "🚀 WAEngine - The most powerful WhatsApp Bot Library with 860+ Working Features, Complete Baileys Integration & Production-Ready Stability",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -107,7 +107,11 @@ export class ConnectionRecovery {
107
107
  }
108
108
 
109
109
  console.log('⚠️ Health check failed:', error.message);
110
- await this.initiateRecovery(error);
110
+ // Fire-and-forget: Recovery läuft unabhängig vom Health-Check-Timer
111
+ this.initiateRecovery(error).catch(e => {
112
+ console.log('🔴 Recovery loop crashed, resetting state:', e?.message || e);
113
+ this.state.isRecovering = false;
114
+ });
111
115
  }
112
116
  }
113
117
 
@@ -121,22 +125,28 @@ export class ConnectionRecovery {
121
125
  this.state.isRecovering = true;
122
126
  this.state.lastError = error;
123
127
  this.state.failureHistory.push({
124
- error: error.message,
128
+ error: error?.message || String(error),
125
129
  timestamp: Date.now(),
126
130
  retryCount: this.state.retryCount
127
131
  });
128
132
 
129
133
  console.log('🛡️ Initiating connection recovery...');
130
134
 
135
+ let attempt = 0;
136
+
131
137
  // Endlose Retry-Schleife: läuft so lange bis Verbindung wieder steht
132
138
  while (this.state.isRecovering) {
139
+ attempt++;
140
+ console.log(`🔁 Recovery attempt #${attempt}...`);
133
141
  try {
134
142
  await this.executeRecoveryStrategies();
135
143
  // Erfolgreich verbunden
136
144
  this.state.isRecovering = false;
145
+ console.log(`✅ Connection restored after ${attempt} attempt(s)`);
137
146
  return;
138
147
  } catch (recoveryError) {
139
- console.log(`❌ Recovery attempt failed: ${recoveryError.message}`);
148
+ const msg = recoveryError?.message || String(recoveryError);
149
+ console.log(`❌ Recovery attempt #${attempt} failed: ${msg}`);
140
150
  console.log('🌐 Waiting for internet... retrying in 5s');
141
151
  // Retrycount zurücksetzen damit nächste Runde wieder alle Strategien versucht
142
152
  this.state.retryCount = 0;