forked from EvolutionAPI/evolution-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendMessage.dto.ts
More file actions
165 lines (146 loc) · 2.92 KB
/
sendMessage.dto.ts
File metadata and controls
165 lines (146 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import { proto, WAPresence } from 'baileys';
export class Quoted {
key: proto.IMessageKey;
message: proto.IMessage;
}
export class Mentions {
everyOne: boolean;
mentioned: string[];
}
export class Options {
delay?: number;
presence?: WAPresence;
quoted?: Quoted;
mentions?: Mentions;
linkPreview?: boolean;
encoding?: boolean;
}
class OptionsMessage {
options: Options;
}
export class Metadata extends OptionsMessage {
number: string;
}
class TextMessage {
text: string;
}
export class StatusMessage {
type: string;
content: string;
statusJidList?: string[];
allContacts?: boolean;
caption?: string;
backgroundColor?: string;
font?: number;
}
class PollMessage {
name: string;
selectableCount: number;
values: string[];
messageSecret?: Uint8Array;
}
export class SendTextDto extends Metadata {
textMessage: TextMessage;
}
export class SendPresence extends Metadata {
textMessage: TextMessage;
}
export class SendStatusDto extends Metadata {
statusMessage: StatusMessage;
}
export class SendPollDto extends Metadata {
pollMessage: PollMessage;
}
export type MediaType = 'image' | 'document' | 'video' | 'audio';
export class MediaMessage {
mediatype: MediaType;
mimetype?: string;
caption?: string;
// for document
fileName?: string;
// url or base64
media: string;
}
export class SendMediaDto extends Metadata {
mediaMessage: MediaMessage;
}
class Sticker {
image: string;
}
export class SendStickerDto extends Metadata {
stickerMessage: Sticker;
}
class Audio {
audio: string;
}
export class SendAudioDto extends Metadata {
audioMessage: Audio;
}
class Button {
buttonText: string;
buttonId: string;
}
class ButtonMessage {
title: string;
description: string;
footerText?: string;
buttons: Button[];
mediaMessage?: MediaMessage;
}
export class SendButtonDto extends Metadata {
buttonMessage: ButtonMessage;
}
class LocationMessage {
latitude: number;
longitude: number;
name?: string;
address?: string;
}
export class SendLocationDto extends Metadata {
locationMessage: LocationMessage;
}
class Row {
title: string;
description: string;
rowId: string;
}
class Section {
title: string;
rows: Row[];
}
class ListMessage {
title: string;
description: string;
footerText?: string;
buttonText: string;
sections: Section[];
}
export class SendListDto extends Metadata {
listMessage: ListMessage;
}
export class ContactMessage {
fullName: string;
wuid: string;
phoneNumber: string;
organization?: string;
email?: string;
url?: string;
}
export class TemplateMessage {
name: string;
language: string;
components: any;
}
export class SendTemplateDto extends Metadata {
templateMessage: TemplateMessage;
}
export class SendContactDto extends Metadata {
contactMessage: ContactMessage[];
}
class ReactionMessage {
key: proto.IMessageKey;
reaction: string;
}
export class SendReactionDto {
reactionMessage: ReactionMessage;
}