@tiledesk/tiledesk-tybot-connector 0.2.72 → 0.2.73
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 +2 -0
- package/index.js +1 -0
- package/models/IntentsMachineFactory.js +5 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -37,6 +37,7 @@ router.post('/ext/:botid', async (req, res) => {
|
|
|
37
37
|
console.log("Removed req.body.payload.request.snapshot field");
|
|
38
38
|
}
|
|
39
39
|
if (log) {console.log("REQUEST BODY:", JSON.stringify(req.body));}
|
|
40
|
+
console.log("REQUEST BODY:", JSON.stringify(req.body));
|
|
40
41
|
|
|
41
42
|
const botId = req.params.botid;
|
|
42
43
|
if (log) {console.log(" :", botId);}
|
|
@@ -5,17 +5,20 @@ class IntentsMachineFactory {
|
|
|
5
5
|
|
|
6
6
|
static getMachine(bot, botId, projectId, log) {
|
|
7
7
|
let machine;
|
|
8
|
-
if (bot.intentsEngine === "tiledesk-ai") {
|
|
8
|
+
if (bot && bot.intentsEngine === "tiledesk-ai") {
|
|
9
9
|
console.log("bot.intentsEngine is tiledesk-ai");
|
|
10
10
|
machine = new TiledeskIntentsMachine(
|
|
11
11
|
{
|
|
12
12
|
botId: botId
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
else {
|
|
15
|
+
else if (bot) {
|
|
16
16
|
if (log) {console.log("Setting MongodbIntentsMachine with bot:", JSON.stringify(bot));}
|
|
17
17
|
machine = new MongodbIntentsMachine({projectId: projectId, language: bot.language, log});
|
|
18
18
|
}
|
|
19
|
+
else {
|
|
20
|
+
console.error("bot is null for:", botId, "on projectId:", projectId);
|
|
21
|
+
}
|
|
19
22
|
return machine;
|
|
20
23
|
}
|
|
21
24
|
|