@tiledesk/tiledesk-whatsapp-connector 0.1.67 → 0.1.69
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/index.js +6 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -897,6 +897,7 @@ router.post("/tiledesk", async (req, res) => {
|
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
899
|
execute(commands[0]);
|
|
900
|
+
|
|
900
901
|
} else if (tiledeskChannelMessage.text || tiledeskChannelMessage.metadata) {
|
|
901
902
|
let whatsappJsonMessage = await tlr.toWhatsapp(
|
|
902
903
|
tiledeskChannelMessage,
|
|
@@ -924,13 +925,13 @@ router.post("/tiledesk", async (req, res) => {
|
|
|
924
925
|
})
|
|
925
926
|
.catch((err) => {
|
|
926
927
|
winston.error("(wab) error send message: ", err);
|
|
927
|
-
res
|
|
928
|
+
return res
|
|
928
929
|
.status(400)
|
|
929
930
|
.send({ success: false, error: "Template not existing" });
|
|
930
931
|
});
|
|
931
932
|
} else {
|
|
932
933
|
winston.error("(wab) Whatsapp Json Message is undefined!");
|
|
933
|
-
res
|
|
934
|
+
return res
|
|
934
935
|
.status(400)
|
|
935
936
|
.send({
|
|
936
937
|
success: false,
|
|
@@ -939,9 +940,11 @@ router.post("/tiledesk", async (req, res) => {
|
|
|
939
940
|
}
|
|
940
941
|
} else {
|
|
941
942
|
winston.debug("(wab) no command, no text --> skip");
|
|
943
|
+
return res.sendStatus(400).send({ success: false, error: "No command or text specified. Skip message."});
|
|
942
944
|
}
|
|
943
|
-
|
|
945
|
+
|
|
944
946
|
return res.sendStatus(200);
|
|
947
|
+
|
|
945
948
|
});
|
|
946
949
|
|
|
947
950
|
// Endpoint for Whatsapp Business
|