@open-wa/wa-automate-types-only 4.33.0 → 4.33.3
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/api/Client.d.ts
CHANGED
@@ -20,6 +20,7 @@ import { NextFunction, Request, Response } from 'express';
|
|
20
20
|
import { Call } from './model/call';
|
21
21
|
import { Button, Section } from './model/button';
|
22
22
|
import { JsonObject } from 'type-fest';
|
23
|
+
import { ReactionEvent } from './model/reactions';
|
23
24
|
export declare enum namespace {
|
24
25
|
Chat = "Chat",
|
25
26
|
Msg = "Msg",
|
@@ -231,6 +232,16 @@ export declare class Client {
|
|
231
232
|
* Listens to new orders. Only works on business accounts
|
232
233
|
*/
|
233
234
|
onNewProduct(fn: (product: Product) => void): Promise<Listener | boolean>;
|
235
|
+
/**
|
236
|
+
* [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
|
237
|
+
*
|
238
|
+
* Listens to reaction add and change events
|
239
|
+
*
|
240
|
+
* @event
|
241
|
+
* @param fn callback
|
242
|
+
* @fires [[ReactionEvent]]
|
243
|
+
*/
|
244
|
+
onReaction(fn: (reactionEvent: ReactionEvent) => void): Promise<Listener | boolean>;
|
234
245
|
/**
|
235
246
|
* [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
|
236
247
|
*
|
@@ -523,9 +534,11 @@ export declare class Client {
|
|
523
534
|
* @param groupId group chat id: `xxxxx@g.us`
|
524
535
|
* @param content text message to add under all of the tags
|
525
536
|
* @param hideTags Removes all tags within the message
|
537
|
+
* @param formatting The formatting of the tags. Use @mention to indicate the actual tag. @default `@mention `
|
538
|
+
* @param messageBeforeTags set to `true` to show the message before all of the tags
|
526
539
|
* @returns `Promise<MessageId>`
|
527
540
|
*/
|
528
|
-
tagEveryone(groupId: GroupChatId, content: Content, hideTags?: boolean): Promise<boolean | MessageId>;
|
541
|
+
tagEveryone(groupId: GroupChatId, content: Content, hideTags?: boolean, formatting?: string, messageBeforeTags?: boolean): Promise<boolean | MessageId>;
|
529
542
|
/**
|
530
543
|
* Sends a link to a chat that includes a link preview.
|
531
544
|
* @param thumb The base 64 data of the image you want to use as the thunbnail. This should be no more than 200x200px. Note: Dont need data url on this param
|
@@ -86,5 +86,10 @@ export declare enum SimpleListener {
|
|
86
86
|
* Requires licence
|
87
87
|
* Represents [[onNewProduct]]
|
88
88
|
*/
|
89
|
-
NewProduct = "onNewProduct"
|
89
|
+
NewProduct = "onNewProduct",
|
90
|
+
/**
|
91
|
+
* Requires licence
|
92
|
+
* Represents [[onReaction]]
|
93
|
+
*/
|
94
|
+
Reaction = "onReaction"
|
90
95
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ChatId, MessageId } from "./aliases";
|
1
|
+
import { ChatId, ContactId, MessageId } from "./aliases";
|
2
2
|
import { Button, Row, Section } from "./button";
|
3
3
|
import { Chat } from "./chat";
|
4
4
|
import { Contact } from "./contact";
|
@@ -84,7 +84,7 @@ export interface Message {
|
|
84
84
|
/**
|
85
85
|
* An array of all mentioned numbers in this message.
|
86
86
|
*/
|
87
|
-
mentionedJidList:
|
87
|
+
mentionedJidList: ContactId[];
|
88
88
|
/**
|
89
89
|
* If the message is of a media type, it may also have a caption
|
90
90
|
*/
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { ContactId } from "./aliases";
|
2
|
+
import { Message, MessageAck } from "./message";
|
3
|
+
/**
|
4
|
+
* A reaction is identified the specific emoji.
|
5
|
+
*/
|
6
|
+
export declare type Reaction = {
|
7
|
+
/**
|
8
|
+
* The aggregate emoji used for the reaction.
|
9
|
+
*/
|
10
|
+
aggregateEmoji: string;
|
11
|
+
/**
|
12
|
+
* The identifier of the reaction
|
13
|
+
*/
|
14
|
+
id: string;
|
15
|
+
/**
|
16
|
+
* If the reaction is also sent by the host account
|
17
|
+
*/
|
18
|
+
hasReactionByMe: boolean;
|
19
|
+
/**
|
20
|
+
* The senders of this spefcific reaction
|
21
|
+
*/
|
22
|
+
senders: ReactionRecord[];
|
23
|
+
};
|
24
|
+
/**
|
25
|
+
* The specific reaction by a user
|
26
|
+
*/
|
27
|
+
export declare type ReactionRecord = {
|
28
|
+
/**
|
29
|
+
* The acknowledgement of the reaction
|
30
|
+
*/
|
31
|
+
ack: MessageAck;
|
32
|
+
/**
|
33
|
+
* The ID of the reaction
|
34
|
+
*/
|
35
|
+
id: string;
|
36
|
+
msgKey: string;
|
37
|
+
parentMsgKey: string;
|
38
|
+
orphan: number;
|
39
|
+
/**
|
40
|
+
* The text of the reaction
|
41
|
+
*/
|
42
|
+
reactionText: string;
|
43
|
+
/**
|
44
|
+
* If the reaction has been read
|
45
|
+
*/
|
46
|
+
read: boolean;
|
47
|
+
/**
|
48
|
+
* The ID of the reaction sender
|
49
|
+
*/
|
50
|
+
senderUserJid: ContactId;
|
51
|
+
/**
|
52
|
+
* The timestamp of the reaction
|
53
|
+
*/
|
54
|
+
timestamp: number;
|
55
|
+
};
|
56
|
+
/**
|
57
|
+
* Emitted by onReaction
|
58
|
+
*/
|
59
|
+
export declare type ReactionEvent = {
|
60
|
+
/**
|
61
|
+
* The message being reacted to
|
62
|
+
*/
|
63
|
+
message: Message;
|
64
|
+
/**
|
65
|
+
* The reaction sent by the host account
|
66
|
+
*/
|
67
|
+
reactionByMe: Reaction;
|
68
|
+
/**
|
69
|
+
* An array of all reactions
|
70
|
+
*/
|
71
|
+
reactions: Reaction[];
|
72
|
+
/**
|
73
|
+
* The type of the reaction event.
|
74
|
+
*/
|
75
|
+
type: 'add' | 'change';
|
76
|
+
};
|
package/dist/utils/tools.d.ts
CHANGED
@@ -19,7 +19,6 @@ export declare const isDataURL: (s: string) => boolean;
|
|
19
19
|
* A convinience method to download the [[DataURL]] of a file
|
20
20
|
* @param url The url
|
21
21
|
* @param optionsOverride You can use this to override the [axios request config](https://github.com/axios/axios#request-config)
|
22
|
-
* @returns Promise<DataURL>
|
23
22
|
*/
|
24
23
|
export declare const getDUrl: (url: string, optionsOverride?: AxiosRequestConfig) => Promise<DataURL>;
|
25
24
|
/**
|