waengine 1.0.9 β†’ 1.0.10

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/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.0.10] - 2025-01-31
6
+
7
+ ### πŸ› Critical Bug Fix
8
+
9
+ #### πŸ€– QuickBot Chaining Problem behoben
10
+ - **FIXED:** `quickBot().when().reply().when()` Chaining funktioniert jetzt
11
+ - **FIXED:** TypeError bei mehreren `.when()` Calls nach `.reply()`
12
+ - **FIXED:** Alle EasyRule Action-Methoden geben Bot-Instanz zurΓΌck
13
+
14
+ #### πŸ”§ Technical Changes
15
+ - EasyRule methods now return bot instance instead of rule for chaining
16
+ - All action methods (reply, send, react, type, etc.) enable further `.when()` calls
17
+ - Perfect chaining: `quickBot().when().reply().when().reply().start()`
18
+
19
+ #### πŸ“Š Impact
20
+ - Fixes critical usability issue with QuickBot API
21
+ - No breaking changes - existing code continues to work
22
+ - Enables intuitive method chaining as originally intended
23
+
24
+ ---
25
+
5
26
  ## [1.0.9] - 2025-01-31
6
27
 
7
28
  ### πŸ”Œ Optional Plugin Loading System
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waengine",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "πŸš€ WAEngine - The most powerful WhatsApp Bot Library with Multi-Device Support & EasyBot API",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/easy-bot.js CHANGED
@@ -413,78 +413,79 @@ class EasyRule {
413
413
  this.actions = [];
414
414
  }
415
415
 
416
- // Actions - Return this rule for chaining!
416
+ // Actions - Return bot for chaining more rules!
417
417
  reply(text) {
418
418
  this.actions.push({ type: 'reply', value: text });
419
- return this; // Rule chaining!
419
+ return this.bot; // Return bot for more .when() calls!
420
420
  }
421
421
 
422
422
  send(text) {
423
- return this.reply(text);
423
+ this.actions.push({ type: 'reply', value: text });
424
+ return this.bot; // Return bot for more .when() calls!
424
425
  }
425
426
 
426
427
  react(emoji) {
427
428
  this.actions.push({ type: 'react', value: emoji });
428
- return this; // Rule chaining!
429
+ return this.bot; // Return bot for more .when() calls!
429
430
  }
430
431
 
431
432
  type(seconds = 2) {
432
433
  this.actions.push({ type: 'type', value: seconds * 1000 });
433
- return this; // Rule chaining!
434
+ return this.bot; // Return bot for more .when() calls!
434
435
  }
435
436
 
436
437
  typeAndReply(text, seconds = 2) {
437
438
  this.type(seconds);
438
439
  this.reply(text);
439
- return this; // Rule chaining!
440
+ return this.bot; // Return bot for more .when() calls!
440
441
  }
441
442
 
442
443
  useTemplate(templateName) {
443
444
  this.actions.push({ type: 'template', value: templateName });
444
- return this; // Rule chaining!
445
+ return this.bot; // Return bot for more .when() calls!
445
446
  }
446
447
 
447
448
  // Media actions
448
449
  sendImage(path, caption = "") {
449
450
  this.actions.push({ type: 'image', value: { path, caption } });
450
- return this;
451
+ return this.bot;
451
452
  }
452
453
 
453
454
  sendSticker(path) {
454
455
  this.actions.push({ type: 'sticker', value: path });
455
- return this;
456
+ return this.bot;
456
457
  }
457
458
 
458
459
  sendLocation(lat, lng) {
459
460
  this.actions.push({ type: 'location', value: { lat, lng } });
460
- return this;
461
+ return this.bot;
461
462
  }
462
463
 
463
464
  // Mention actions
464
465
  mentionSender(text) {
465
466
  this.actions.push({ type: 'mentionSender', value: text });
466
- return this;
467
+ return this.bot;
467
468
  }
468
469
 
469
470
  mentionAll(text) {
470
471
  this.actions.push({ type: 'mentionAll', value: text });
471
- return this;
472
+ return this.bot;
472
473
  }
473
474
 
474
475
  mentionUser(text, userJid) {
475
476
  this.actions.push({ type: 'mentionUser', value: { text, userJid } });
476
- return this;
477
+ return this.bot;
477
478
  }
478
479
 
479
480
  // Delete actions
480
481
  deleteMessage() {
481
482
  this.actions.push({ type: 'delete' });
482
- return this;
483
+ return this.bot;
483
484
  }
484
485
 
485
486
  deleteAfter(seconds) {
486
487
  this.actions.push({ type: 'deleteAfter', value: seconds });
487
- return this;
488
+ return this.bot;
488
489
  }
489
490
 
490
491
  // End chaining - return bot