wingbot 3.43.0 → 3.43.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/package.json +1 -1
- package/src/Ai.js +3 -1
- package/src/resolvers/message.js +7 -0
package/package.json
CHANGED
package/src/Ai.js
CHANGED
|
@@ -49,6 +49,8 @@ let uq = 1;
|
|
|
49
49
|
/** @typedef {import('./wingbot/CustomEntityDetectionModel').EntityDetector} EntityDetector */
|
|
50
50
|
/** @typedef {import('./wingbot/CustomEntityDetectionModel').DetectorOptions} DetectorOptions */
|
|
51
51
|
|
|
52
|
+
/** @typedef {[string,EntityDetector|RegExp,DetectorOptions]} DetectorArgs */
|
|
53
|
+
|
|
52
54
|
/**
|
|
53
55
|
* @class Ai
|
|
54
56
|
*/
|
|
@@ -63,7 +65,7 @@ class Ai {
|
|
|
63
65
|
|
|
64
66
|
/**
|
|
65
67
|
* @private
|
|
66
|
-
* @type {Map<string,
|
|
68
|
+
* @type {Map<string,DetectorArgs>}
|
|
67
69
|
*/
|
|
68
70
|
this._detectors = new Map(
|
|
69
71
|
systemEntities.map((a) => [a[0], a])
|
package/src/resolvers/message.js
CHANGED
|
@@ -40,6 +40,13 @@ function getVoiceControlFromParams (params, lang = null) {
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
// remove empty values ("")
|
|
44
|
+
Object.keys(voiceControl).forEach((key) => {
|
|
45
|
+
if (voiceControl[key] === '') {
|
|
46
|
+
delete voiceControl[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
43
50
|
// if voiceControl is empty, return null
|
|
44
51
|
return Object.keys(voiceControl).length > 0 ? voiceControl : null;
|
|
45
52
|
}
|