@open-wa/wa-automate 4.35.4 → 4.35.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,7 @@ import { Listener } from 'eventemitter2';
18
18
  import PriorityQueue from 'p-queue/dist/priority-queue';
19
19
  import { NextFunction, Request, Response } from 'express';
20
20
  import { Call } from './model/call';
21
- import { Button, Section } from './model/button';
21
+ import { Button, LocationButtonBody, Section } from './model/button';
22
22
  import { JsonObject } from 'type-fest';
23
23
  import { ReactionEvent } from './model/reactions';
24
24
  export declare enum namespace {
@@ -485,15 +485,15 @@ export declare class Client {
485
485
  */
486
486
  sendPaymentRequest(to: ChatId, amount: number, currency: string, message?: string): Promise<boolean | MessageId>;
487
487
  /**
488
- * Send generic quick reply buttons
488
+ * Send generic quick reply buttons. This is an insiders feature for MD accounts.
489
489
  *
490
490
  * @param {ChatId} to chat id
491
- * @param {string} body The body of the buttons message
491
+ * @param {string | LocationButtonBody} body The body of the buttons message
492
492
  * @param {Button[]} buttons Array of buttons - limit is 3!
493
493
  * @param {string} title The title/header of the buttons message
494
494
  * @param {string} footer The footer of the buttons message
495
495
  */
496
- sendButtons(to: ChatId, body: string, buttons: Button[], title: string, footer?: string): Promise<boolean | MessageId>;
496
+ sendButtons(to: ChatId, body: string | LocationButtonBody, buttons: Button[], title?: string, footer?: string): Promise<boolean | MessageId>;
497
497
  /**
498
498
  * Send a banner image
499
499
  *
@@ -258,7 +258,7 @@ class Client {
258
258
  if ((((_d = this._createConfig) === null || _d === void 0 ? void 0 : _d.autoEmoji) === undefined || ((_e = this._createConfig) === null || _e === void 0 ? void 0 : _e.autoEmoji)) && !this._autoEmojiSet) {
259
259
  const ident = typeof ((_f = this._createConfig) === null || _f === void 0 ? void 0 : _f.autoEmoji) === "string" ? (_g = this._createConfig) === null || _g === void 0 ? void 0 : _g.autoEmoji : ":";
260
260
  this.onMessage((message) => __awaiter(this, void 0, void 0, function* () {
261
- if (message.body && message.body.startsWith(ident) && message.body.endsWith(ident)) {
261
+ if ((message === null || message === void 0 ? void 0 : message.body) && message.body.startsWith(ident) && message.body.endsWith(ident)) {
262
262
  const emojiId = message.body.replace(new RegExp(ident, 'g'), "");
263
263
  if (!emojiId)
264
264
  return;
@@ -1272,10 +1272,10 @@ class Client {
1272
1272
  });
1273
1273
  }
1274
1274
  /**
1275
- * Send generic quick reply buttons
1275
+ * Send generic quick reply buttons. This is an insiders feature for MD accounts.
1276
1276
  *
1277
1277
  * @param {ChatId} to chat id
1278
- * @param {string} body The body of the buttons message
1278
+ * @param {string | LocationButtonBody} body The body of the buttons message
1279
1279
  * @param {Button[]} buttons Array of buttons - limit is 3!
1280
1280
  * @param {string} title The title/header of the buttons message
1281
1281
  * @param {string} footer The footer of the buttons message
@@ -11,3 +11,8 @@ export interface Section {
11
11
  title: string;
12
12
  rows: Row[];
13
13
  }
14
+ export interface LocationButtonBody {
15
+ lat: number;
16
+ lng: number;
17
+ caption: string;
18
+ }
@@ -341,6 +341,10 @@ function create(config = {}) {
341
341
  WAToken1: localStorage.WAToken1,
342
342
  WAToken2: localStorage.WAToken2
343
343
  };
344
+ if (config.multiDevice) {
345
+ delete sessionData.WABrowserId;
346
+ logging_1.log.info("Multi-device detected. Removing Browser ID from session data to prevent session reauth corruption");
347
+ }
344
348
  const sdB64 = Buffer.from(JSON.stringify(sessionData)).toString('base64');
345
349
  spinner.emit(sessionData, "sessionData");
346
350
  spinner.emit(sdB64, "sessionDataBase64");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.35.4",
3
+ "version": "4.35.7",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",