wingbot 3.53.1 → 3.53.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.53.1",
3
+ "version": "3.53.2",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -192,15 +192,9 @@ function selectTranslation (resolverId, params, texts, data) {
192
192
  const key = `_R_${resolverId}`;
193
193
  let { lang, [key]: seqState } = data;
194
194
 
195
- if (texts.length === 0) {
196
- console.log('MSG0-P', params); // eslint-disable-line no-console
197
- console.log('MSG0-D', { resolverId, texts }); // eslint-disable-line no-console
198
- throw new Error(`Resolver ${resolverId} failed ${JSON.stringify(params.text).replace(/"([^"]+)":/g, '$1:')}`);
199
- }
200
-
201
- if (texts.length === 1) {
195
+ if (texts.length <= 1) {
202
196
  return [
203
- renderMessageText(texts[0].t, data),
197
+ texts[0] ? renderMessageText(texts[0].t, data) : '',
204
198
  seqState && resolverId
205
199
  ? vars.expiresAfter(key, null, 1)
206
200
  : {}
@@ -226,11 +220,7 @@ function selectTranslation (resolverId, params, texts, data) {
226
220
  const index = data._expandRandomTexts
227
221
  ? 1
228
222
  : Math.floor(Math.random() * texts.length);
229
- if (!texts[index]) {
230
- console.log('MSG-P', params); // eslint-disable-line no-console
231
- console.log('MSG-D', { resolverId, texts }); // eslint-disable-line no-console
232
- throw new Error(`Resolver ${resolverId} failed ${JSON.stringify(params.text).replace(/"([^"]+)":/g, '$1:')}`);
233
- }
223
+
234
224
  return [
235
225
  renderMessageText(texts[index].t, data),
236
226
  seqState