@tiledesk/tiledesk-tybot-connector 0.2.40 → 0.2.41
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 -1
- package/models/TiledeskChatbotUtil.js +10 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
-
# v0.2.
|
|
8
|
+
# v0.2.41
|
|
9
|
+
- added attribute currentPhoneNumber
|
|
10
|
+
- added attribute tickeId
|
|
11
|
+
|
|
12
|
+
# v0.2.40
|
|
9
13
|
- refactorized Make action
|
|
10
14
|
- added support for public gptkey for GptTask and AskGPT actions
|
|
11
15
|
- fixes bug: AskGPT action not working
|
|
@@ -453,18 +453,13 @@ class TiledeskChatbotUtil {
|
|
|
453
453
|
await chatbot.addParameter("userEmail", message.request.lead.email);
|
|
454
454
|
}
|
|
455
455
|
if (message.request.lead.fullname) {
|
|
456
|
-
console.log("got lead.fullname:", message.request.lead.fullname);
|
|
457
456
|
try {
|
|
458
457
|
const current_userFullname = await chatbot.getParameter("userFullname");
|
|
459
|
-
console.log("current_userFullname:", current_userFullname);
|
|
460
458
|
if (current_userFullname && current_userFullname.startsWith("guest#")) {
|
|
461
|
-
console.log("current_userFullname && current_userFullname.startsWith('guest#')");
|
|
462
459
|
await chatbot.addParameter("userFullname", message.request.lead.fullname);
|
|
463
460
|
}
|
|
464
461
|
else if (!current_userFullname) {
|
|
465
|
-
console.log("no current_userFullname");
|
|
466
462
|
await chatbot.addParameter("userFullname", message.request.lead.fullname);
|
|
467
|
-
console.log("it was null, set to the incoming one");
|
|
468
463
|
}
|
|
469
464
|
}
|
|
470
465
|
catch(error) {
|
|
@@ -474,15 +469,25 @@ class TiledeskChatbotUtil {
|
|
|
474
469
|
else {
|
|
475
470
|
console.log("!lead.fullname");
|
|
476
471
|
}
|
|
472
|
+
// console.log("Getting userPhone:", JSON.stringify(message.request));
|
|
477
473
|
if (message.request.lead.phone) {
|
|
478
474
|
await chatbot.addParameter("userPhone", message.request.lead.phone);
|
|
479
475
|
}
|
|
476
|
+
if (message.request.lead.lead_id && message.request.lead.lead_id.startsWith("wab-")) {
|
|
477
|
+
const splits = message.request.lead.lead_id.split("-");
|
|
478
|
+
if (splits && splits.length > 1) {
|
|
479
|
+
await chatbot.addParameter("currentPhoneNumber",splits[1]);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
480
482
|
if (message.request.lead.lead_id) {
|
|
481
483
|
await chatbot.addParameter("userLeadId", message.request.lead.lead_id);
|
|
482
484
|
}
|
|
483
485
|
if (message.request.lead.company) {
|
|
484
486
|
await chatbot.addParameter("userCompany", message.request.lead.company);
|
|
485
487
|
}
|
|
488
|
+
if (message.request.ticket_id) {
|
|
489
|
+
await chatbot.addParameter("ticketId", message.request.ticket_id);
|
|
490
|
+
}
|
|
486
491
|
}
|
|
487
492
|
}
|
|
488
493
|
|