@adatechnology/meta-whatsapp-module 0.3.1 → 0.4.0
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/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -2639,6 +2639,10 @@ function extractContent(message) {
|
|
|
2639
2639
|
const items = message.order.product_items.reduce((sum, item) => sum + item.quantity, 0);
|
|
2640
2640
|
return `Pedido: ${items} item(ns)`;
|
|
2641
2641
|
}
|
|
2642
|
+
if (message.location) {
|
|
2643
|
+
const label = message.location.name ?? message.location.address;
|
|
2644
|
+
return label ? `\u{1F4CD} Localiza\xE7\xE3o: ${label}` : "\u{1F4CD} Localiza\xE7\xE3o";
|
|
2645
|
+
}
|
|
2642
2646
|
return message.image?.caption ?? message.document?.caption ?? null;
|
|
2643
2647
|
}
|
|
2644
2648
|
__name(extractContent, "extractContent");
|
|
@@ -2651,6 +2655,7 @@ function extractPayload(message) {
|
|
|
2651
2655
|
if (message.video) payload["video"] = message.video;
|
|
2652
2656
|
if (message.document) payload["document"] = message.document;
|
|
2653
2657
|
if (message.sticker) payload["sticker"] = message.sticker;
|
|
2658
|
+
if (message.location) payload["location"] = message.location;
|
|
2654
2659
|
if (message.context?.referred_product) payload["referredProduct"] = message.context.referred_product;
|
|
2655
2660
|
return Object.keys(payload).length > 0 ? payload : null;
|
|
2656
2661
|
}
|