@open-wa/wa-automate 4.23.9 → 4.23.10

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.
@@ -235,12 +235,13 @@ const setupTwilioCompatibleWebhook = (cliConfig, client) => {
235
235
  exports.setupTwilioCompatibleWebhook = setupTwilioCompatibleWebhook;
236
236
  const setupBotPressHandler = (cliConfig, client) => {
237
237
  const u = cliConfig.botPressUrl;
238
- const sendBotPressMessage = (text, chatId) => __awaiter(void 0, void 0, void 0, function* () {
238
+ const sendBotPressMessage = (text, chatId, message) => __awaiter(void 0, void 0, void 0, function* () {
239
239
  const url = `${u.split("/").slice(0, u.split("/").findIndex(x => x == "converse")).join("/")}/converse/${chatId.replace("@c.us", "").replace("@g.us", "")}`;
240
240
  try {
241
241
  const { data } = yield axios_1.default.post(url, {
242
242
  "type": "text",
243
- text
243
+ text,
244
+ metadata: message
244
245
  });
245
246
  const { responses } = data;
246
247
  return yield Promise.all(responses.filter(({ type }) => type != "typing").map((response) => {
@@ -298,10 +299,10 @@ const setupBotPressHandler = (cliConfig, client) => {
298
299
  text = message.cloudUrl;
299
300
  break;
300
301
  default:
301
- text = message.body;
302
+ text = message.body || "__UNHANDLED__";
302
303
  break;
303
304
  }
304
- yield sendBotPressMessage(text, message.from);
305
+ yield sendBotPressMessage(text, message.from, message);
305
306
  }));
306
307
  };
307
308
  exports.setupBotPressHandler = setupBotPressHandler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.23.9",
3
+ "version": "4.23.10",
4
4
  "licenseCheckUrl": "https://openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",