wingbot 3.33.1 → 3.33.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Tester.js +6 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.33.1",
3
+ "version": "3.33.2",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Tester.js CHANGED
@@ -460,8 +460,7 @@ class Tester {
460
460
  * @memberOf Tester
461
461
  */
462
462
  async quickReplyText (text) {
463
- let found = '';
464
- let but = 'has not been found';
463
+ let but = 'has not been found.';
465
464
 
466
465
  if (this.responses.length !== 0) {
467
466
  const normalize = (t) => `${t}`.toLocaleLowerCase().replace(/\s+/g, ' ').trim();
@@ -484,13 +483,15 @@ class Tester {
484
483
  }
485
484
 
486
485
  if (res.length > 1) {
487
- but = 'found multiple occurences';
486
+ but = 'found, but there are multiple occurences.';
488
487
  }
489
488
 
490
- found = ` (found: ${quickReplys.map((q) => q.title).filter((q) => !!q).join(', ')})`;
489
+ but += quickReplys.length
490
+ ? ` (found: ${quickReplys.map((q) => q.title).filter((q) => !!q).join(', ')})`
491
+ : ' (no quick replies available)';
491
492
  }
492
493
 
493
- throw new Error(`Quick reply "${text}" was required, but ${but}.${found}`);
494
+ throw new Error(`Quick reply "${text}" ${but}`);
494
495
  }
495
496
 
496
497
  /**