@tiledesk/tiledesk-tybot-connector 2.0.8-rc1 → 2.0.8
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 +5 -31
- package/Logger.js +13 -30
- package/TdCache copy.js +242 -0
- package/engine/mock/MockBotsDataSource.js +2 -1
- package/index.js +0 -3
- package/logs/app1.log +3052 -0
- package/package.json +2 -3
- package/services/IntegrationService.js +1 -1
- package/services/TilebotService.js +1 -1
- package/tiledeskChatbotPlugs/DirectivesChatbotPlug.js +8 -20
- package/tiledeskChatbotPlugs/directives/DirIntent.js +4 -6
- package/tiledeskChatbotPlugs/directives/DirReply.js +14 -6
- package/tiledeskChatbotPlugs/directives/DirWebRequestV2_old.js +417 -0
- package/tiledeskChatbotPlugs/directives/DirWebResponse.js +38 -0
- package/tiledeskChatbotPlugs/directives/Directives.js +0 -1
- package/utils/TiledeskChatbotUtil.js +27 -3
|
@@ -319,31 +319,55 @@ class TiledeskChatbotUtil {
|
|
|
319
319
|
json_buttons.forEach(button => {
|
|
320
320
|
if (button.value && button.type === "action" && button.action) {
|
|
321
321
|
button.show_echo = true;
|
|
322
|
+
// console.log("pushing:", button)
|
|
322
323
|
final_buttons.push(button);
|
|
323
324
|
}
|
|
324
325
|
else if (button.value && button.type === "text") {
|
|
325
326
|
button.show_echo = true;
|
|
327
|
+
// console.log("pushing:", button)
|
|
326
328
|
final_buttons.push(button);
|
|
327
329
|
}
|
|
328
330
|
else if (button.value && button.type === "url" && button.link) {
|
|
329
331
|
button.show_echo = true;
|
|
332
|
+
// console.log("pushing:", button)
|
|
330
333
|
final_buttons.push(button);
|
|
331
334
|
}
|
|
332
335
|
else {
|
|
333
|
-
|
|
336
|
+
console.log("Invalid button. Skipping:", JSON.stringify(button) );
|
|
334
337
|
}
|
|
335
338
|
});
|
|
336
339
|
}
|
|
340
|
+
|
|
341
|
+
// "buttons": [
|
|
342
|
+
// {
|
|
343
|
+
// "type": "action",
|
|
344
|
+
// "value": "Button1", // obbligatorio sempre
|
|
345
|
+
// "action": "#bb347206-d639-4926-94c9-e94930623dce", // mandatory
|
|
346
|
+
// "show_echo": true, // lo inserisco sempre
|
|
347
|
+
// "alias": "button1 alias"
|
|
348
|
+
// },
|
|
349
|
+
// {
|
|
350
|
+
// "type": "text",
|
|
351
|
+
// "value": "Button2 text", // obbligatorio sempre
|
|
352
|
+
// "show_echo": true // lo inserisco sempre
|
|
353
|
+
// },
|
|
354
|
+
// {
|
|
355
|
+
// "type": "url",
|
|
356
|
+
// "value": "Button3 link", // obbligatorio sempre
|
|
357
|
+
// "link": "http://", // obbligatorio
|
|
358
|
+
// "show_echo": true // lo inserisco sempre
|
|
359
|
+
// }
|
|
360
|
+
// ]
|
|
337
361
|
}
|
|
338
362
|
catch(error) {
|
|
339
|
-
|
|
363
|
+
console.error("Invalid json_buttons:", error)
|
|
340
364
|
}
|
|
341
365
|
if (final_buttons && final_buttons.length > 0) {
|
|
342
366
|
command.message.attributes.attachment.buttons = final_buttons;
|
|
343
367
|
delete command.message.attributes.attachment.json_buttons;
|
|
344
368
|
}
|
|
345
369
|
else {
|
|
346
|
-
|
|
370
|
+
console.log("Invalid json_buttons. Skipping")
|
|
347
371
|
}
|
|
348
372
|
}
|
|
349
373
|
}
|