wingbot 3.24.2 → 3.24.3

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/Request.js +12 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.24.2",
3
+ "version": "3.24.3",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Request.js CHANGED
@@ -338,16 +338,22 @@ class Request {
338
338
 
339
339
  const entities = intent.entities || [];
340
340
 
341
- const templateData = {
341
+ let templateData = {
342
342
  ...stateData(this),
343
343
  ...getSetState(setState || {}, this),
344
344
  intent: intent.intent,
345
- entities,
346
- ...entities.reduceRight((o, e) => ({
347
- ...o,
348
- [`@${e.entity}`]: e.value
349
- }), {})
345
+ entities
350
346
  };
347
+ Object.keys(templateData)
348
+ .forEach((key) => {
349
+ if (key.match(/^@/)) {
350
+ delete templateData[key];
351
+ }
352
+ });
353
+ templateData = entities.reduceRight((o, e) => ({
354
+ ...o,
355
+ [`@${e.entity}`]: e.value
356
+ }), templateData);
351
357
 
352
358
  const textTemplate = typeof title === 'function'
353
359
  ? title