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