@tiledesk/tiledesk-tybot-connector 0.2.24 → 0.2.25
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 -2
- package/index.js +4 -4
- package/models/TiledeskChatbot.js +11 -0
- package/models/TiledeskChatbotUtil.js +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
+
### v0.2.25
|
|
9
|
+
- added support for native connect to block
|
|
10
|
+
- added TiledeskChatbotUtil.addConnectAction()
|
|
11
|
+
|
|
8
12
|
### v0.2.24
|
|
9
|
-
- Patch for the misleading \\start training phrase. Added: if (message.text === "\\start") { message.text = "/start" }
|
|
10
13
|
- Added Qapla action
|
|
11
|
-
- Fixed bug: the 3.5 turbo model was always used in GptTask action
|
|
14
|
+
- Fixed bug: the 3.5 turbo model was always used in GptTask action
|
|
12
15
|
|
|
13
16
|
### v0.2.23
|
|
14
17
|
- Fixed CaptureUserReply. Added Check for missing goToIntent
|
package/index.js
CHANGED
|
@@ -148,10 +148,10 @@ router.post('/ext/:botid', async (req, res) => {
|
|
|
148
148
|
log: log
|
|
149
149
|
});
|
|
150
150
|
if (log) {console.log("MESSAGE CONTAINS:", message.text);}
|
|
151
|
-
if (message.text === "\\\\start") { // patch for the misleading \\start training phrase
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
151
|
+
// if (message.text === "\\\\start") { // patch for the misleading \\start training phrase
|
|
152
|
+
// if (log) {console.log("forced conversion of \\\\start /start");}
|
|
153
|
+
// message.text = "/start";
|
|
154
|
+
// }
|
|
155
155
|
await TiledeskChatbotUtil.updateRequestAttributes(chatbot, message, projectId, requestId);
|
|
156
156
|
await TiledeskChatbotUtil.updateConversationTranscript(chatbot, message);
|
|
157
157
|
|
|
@@ -477,6 +477,17 @@ class TiledeskChatbot {
|
|
|
477
477
|
};
|
|
478
478
|
|
|
479
479
|
let static_bot_answer;
|
|
480
|
+
if (answerObj.actions) {
|
|
481
|
+
const actions_length = answerObj.actions.length;
|
|
482
|
+
TiledeskChatbotUtil.addConnectAction(answerObj);
|
|
483
|
+
if (this.log) {
|
|
484
|
+
const new_actions_length = answerObj.actions.length;
|
|
485
|
+
if (new_actions_length > actions_length) {
|
|
486
|
+
console.log("Added connect to block action. All actions now:", JSON.stringify(answerObj.actions));
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
480
491
|
if (answerObj.actions && answerObj.actions.length > 0) {
|
|
481
492
|
static_bot_answer = { // actions workflow will be executed
|
|
482
493
|
actions: answerObj.actions
|
|
@@ -527,7 +527,17 @@ class TiledeskChatbotUtil {
|
|
|
527
527
|
});
|
|
528
528
|
}
|
|
529
529
|
return directives;
|
|
530
|
-
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
static addConnectAction(reply) {
|
|
533
|
+
// console.log("reply foraddConnectAction:", reply);
|
|
534
|
+
if (reply && reply.attributes && reply.attributes.nextBlockAction) {
|
|
535
|
+
if (reply.actions) {
|
|
536
|
+
reply.actions.push(reply.attributes.nextBlockAction);
|
|
537
|
+
// console.log("actions are:", reply.actions)
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
531
541
|
|
|
532
542
|
}
|
|
533
543
|
|