@open-wa/wa-automate-types-only 4.37.5 → 4.39.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.
@@ -19,7 +19,7 @@ import { Listener } from 'eventemitter2';
19
19
  import PriorityQueue from 'p-queue/dist/priority-queue';
20
20
  import { NextFunction, Request, Response } from 'express';
21
21
  import { Call } from './model/call';
22
- import { Button, LocationButtonBody, Section } from './model/button';
22
+ import { AdvancedButton, Button, LocationButtonBody, Section } from './model/button';
23
23
  import { JsonObject } from 'type-fest';
24
24
  import { ReactionEvent } from './model/reactions';
25
25
  export declare enum namespace {
@@ -178,6 +178,13 @@ export declare class Client {
178
178
  * @fires [[Message]]
179
179
  */
180
180
  onButton(fn: (message: Message) => void): Promise<Listener | boolean>;
181
+ /**
182
+ * Listens to broadcast messages
183
+ * @event
184
+ * @param fn callback
185
+ * @fires [[Message]]
186
+ */
187
+ onBroadcast(fn: (message: Message) => void): Promise<Listener | boolean>;
181
188
  /**
182
189
  * Listens to battery changes
183
190
  *
@@ -508,6 +515,21 @@ export declare class Client {
508
515
  * @param {string} footer The footer of the buttons message
509
516
  */
510
517
  sendButtons(to: ChatId, body: string | LocationButtonBody, buttons: Button[], title?: string, footer?: string): Promise<boolean | MessageId>;
518
+ /**
519
+ * {@license:insiders@}
520
+ *
521
+ * Send advanced buttons with media body. This is an insiders feature for MD accounts.
522
+ *
523
+ * Body can be location, image, video or document. Buttons can be quick reply, url or call buttons.
524
+ *
525
+ * @param {ChatId} to chat id
526
+ * @param {string | LocationButtonBody} body The body of the buttons message
527
+ * @param {AdvancedButton[]} buttons Array of buttons - limit is 3!
528
+ * @param {string} title The title/header of the buttons message
529
+ * @param {string} footer The footer of the buttons message
530
+ * @param {string} filename Required if body is a file!!
531
+ */
532
+ sendAdvancedButtons(to: ChatId, body: string | LocationButtonBody, buttons: AdvancedButton[], text: string, footer: string, filename: string): Promise<boolean | MessageId>;
511
533
  /**
512
534
  * Send a banner image
513
535
  *
@@ -519,7 +541,7 @@ export declare class Client {
519
541
  sendBanner(to: ChatId, base64: Base64): Promise<boolean | MessageId>;
520
542
  /**
521
543
  * {@license:insiders@}
522
- * <span theme="badge contrast license">Insiders</span>
544
+ *
523
545
  * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
524
546
  *
525
547
  * Send a list message. This will not work when being sent from business accounts!
@@ -564,7 +586,7 @@ export declare class Client {
564
586
  * @param chatId The chat you want to send this message to.
565
587
  *
566
588
  */
567
- sendMessageWithThumb(thumb: string, url: string, title: string, description: string, text: Content, chatId: ChatId): Promise<MessageId | string | boolean>;
589
+ sendMessageWithThumb(thumb: string, url: string, title: string, description: string, text: Content, chatId: ChatId): Promise<MessageId | boolean>;
568
590
  /**
569
591
  * Sends a location message to given chat
570
592
  * @param to chat id: `xxxxx@c.us`
@@ -2,6 +2,12 @@ export interface Button {
2
2
  id: string;
3
3
  text: string;
4
4
  }
5
+ export interface AdvancedButton {
6
+ id?: string;
7
+ text: string;
8
+ url?: string;
9
+ number?: string;
10
+ }
5
11
  export interface Row {
6
12
  title: string;
7
13
  description: string;
@@ -62,6 +62,10 @@ export declare enum SimpleListener {
62
62
  * Represents [[onButton]]
63
63
  */
64
64
  Button = "onButton",
65
+ /**
66
+ * Represents [[onBroadcast]]
67
+ */
68
+ Broadcast = "onBroadcast",
65
69
  /**
66
70
  * Represents [[onLabel]]
67
71
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate-types-only",
3
- "version": "4.37.5",
3
+ "version": "4.39.0",
4
4
  "description": "Types generated from the @open-wa/wa-automate package",
5
5
  "scripts": {
6
6
  "build": "tsc",