@vanzxy/baileys 2.0.0 → 2.0.2
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/NOTICE.md +1 -2
- package/README.md +63 -2
- package/lib/{Utils → Builders}/A2UI.js +2 -2
- package/lib/Builders/AIRich.js +2047 -0
- package/lib/Builders/Album.js +71 -0
- package/lib/Builders/Button.js +883 -0
- package/lib/Builders/ButtonV2.js +144 -0
- package/lib/Builders/ButtonV3.js +184 -0
- package/lib/Builders/Carousel.js +111 -0
- package/lib/Builders/Contact.js +83 -0
- package/lib/Builders/Location.js +151 -0
- package/lib/Builders/NativeFlow.js +210 -0
- package/lib/Builders/Poll.js +128 -0
- package/lib/Builders/VanzxyBaileys.js +146 -0
- package/lib/Builders/index.js +15 -0
- package/lib/Builders/shared.js +652 -0
- package/lib/Utils/MessageBuilder.js +2 -4405
- package/lib/Utils/index.d.ts +2 -0
- package/lib/Utils/index.js +0 -1
- package/lib/index.js +3 -0
- package/package.json +4 -7
- package/postinstall-banner.js +51 -25
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { BaseBuilder, generateWAMessageFromContent, prepareWAMessageMedia, generateMessageIDV2, crypto } from './shared.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interactive/nativeFlow message builder — the modern replacement for the legacy
|
|
5
|
+
* hydrated-template buttons in `ButtonV3`. Produces the `interactiveMessage` shape
|
|
6
|
+
* (`cta_url`, `cta_copy`, `cta_call`, `quick_reply`, `single_select`) that
|
|
7
|
+
* `generateWAMessageContent` already understands via the `message.nativeFlow`
|
|
8
|
+
* shorthand (see Utils/messages.js, `hasNonNullishProperty(message, 'nativeFlow')`).
|
|
9
|
+
*/
|
|
10
|
+
class NativeFlow extends BaseBuilder {
|
|
11
|
+
#client;
|
|
12
|
+
|
|
13
|
+
/** @param {import('../../WAProto/index.js').WASocket} client Active Baileys socket (must expose `sendMessage`). */
|
|
14
|
+
constructor(client) {
|
|
15
|
+
super();
|
|
16
|
+
if (!client) throw new Error('Socket is required');
|
|
17
|
+
this.#client = client;
|
|
18
|
+
|
|
19
|
+
this._buttons = [];
|
|
20
|
+
this._text;
|
|
21
|
+
this._caption;
|
|
22
|
+
this._title;
|
|
23
|
+
this._subtitle;
|
|
24
|
+
this._footer;
|
|
25
|
+
this._audioFooter;
|
|
26
|
+
this._thumbnail;
|
|
27
|
+
this._media;
|
|
28
|
+
this._offer;
|
|
29
|
+
this._optionTitle;
|
|
30
|
+
this._optionText;
|
|
31
|
+
this._bizJid;
|
|
32
|
+
this._shopSurface;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Plain text body (no header). Mutually exclusive with `setCaption()`. */
|
|
36
|
+
setText(text) {
|
|
37
|
+
if (typeof text !== 'string' || !text) throw new TypeError('setText(text) requires a non-empty string');
|
|
38
|
+
this._text = text;
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Body text shown together with a media/title header — pair with `setHeader()` and/or `setImage()/setVideo()/setDocument()`. */
|
|
43
|
+
setCaption(caption) {
|
|
44
|
+
if (typeof caption !== 'string' || !caption) throw new TypeError('setCaption(caption) requires a non-empty string');
|
|
45
|
+
this._caption = caption;
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Header title/subtitle shown above the caption. Requires a media header (see `setImage()` etc.) or leave media unset for a text-only header. */
|
|
50
|
+
setHeader(title = '', subtitle = '') {
|
|
51
|
+
this._title = title;
|
|
52
|
+
this._subtitle = subtitle;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Footer text under the buttons. Mutually exclusive with `setAudioFooter()`. */
|
|
57
|
+
setFooter(text) {
|
|
58
|
+
this._footer = text;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Voice-note footer instead of text. @param {string|Buffer} path Url or buffer. */
|
|
63
|
+
setAudioFooter(path) {
|
|
64
|
+
if (!path) throw new Error('Url or buffer needed');
|
|
65
|
+
this._audioFooter = path;
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Raw jpeg thumbnail bytes for the header (used when the header media itself isn't re-uploaded). */
|
|
70
|
+
setThumbnail(buffer) {
|
|
71
|
+
this._thumbnail = buffer;
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Attach an image as the header. @param {string|Buffer} path Url or buffer. */
|
|
76
|
+
setImage(path, options = {}) {
|
|
77
|
+
if (!path) throw new Error('Url or buffer needed');
|
|
78
|
+
this._media = Buffer.isBuffer(path) ? { image: path, ...options } : { image: { url: path }, ...options };
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Attach a video as the header. @param {string|Buffer} path Url or buffer. */
|
|
83
|
+
setVideo(path, options = {}) {
|
|
84
|
+
if (!path) throw new Error('Url or buffer needed');
|
|
85
|
+
this._media = Buffer.isBuffer(path) ? { video: path, ...options } : { video: { url: path }, ...options };
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Attach a document as the header. @param {string|Buffer} path Url or buffer. */
|
|
90
|
+
setDocument(path, options = {}) {
|
|
91
|
+
if (!path) throw new Error('Url or buffer needed');
|
|
92
|
+
this._media = Buffer.isBuffer(path) ? { document: path, ...options } : { document: { url: path }, ...options };
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Set a raw pre-built header media object (bypasses setImage/setVideo/setDocument shorthands). */
|
|
97
|
+
setMedia(obj) {
|
|
98
|
+
if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) throw new TypeError('Media must be a plain object');
|
|
99
|
+
this._media = obj;
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Remove every button added so far (keeps text/header/footer/media). */
|
|
104
|
+
clearButtons() {
|
|
105
|
+
this._buttons = [];
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** `quick_reply` button — fires a regular button-response callback. */
|
|
110
|
+
addQuickReply(displayText, id = crypto.randomUUID(), { icon } = {}) {
|
|
111
|
+
if (typeof displayText !== 'string' || !displayText) throw new TypeError('addQuickReply(displayText, id) requires a non-empty displayText');
|
|
112
|
+
this._buttons.push({ text: displayText, id, icon });
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** `cta_url` button — opens a link, optionally inside WhatsApp's in-app webview. */
|
|
117
|
+
addUrl(displayText, url, { useWebview = false, icon } = {}) {
|
|
118
|
+
if (typeof url !== 'string' || !url) throw new TypeError('addUrl(displayText, url) requires a non-empty url');
|
|
119
|
+
this._buttons.push({ text: displayText, url, useWebview, icon });
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** `cta_copy` button — copies text/code to the recipient's clipboard. */
|
|
124
|
+
addCopy(displayText, copyCode, { icon } = {}) {
|
|
125
|
+
if (typeof copyCode !== 'string' || !copyCode) throw new TypeError('addCopy(displayText, copyCode) requires a non-empty copyCode');
|
|
126
|
+
this._buttons.push({ text: displayText, copy: copyCode, icon });
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** `cta_call` button — dials a phone number. */
|
|
131
|
+
addCall(displayText, phoneNumber, { icon } = {}) {
|
|
132
|
+
if (typeof phoneNumber !== 'string' || !phoneNumber) throw new TypeError('addCall(displayText, phoneNumber) requires a non-empty phoneNumber');
|
|
133
|
+
this._buttons.push({ text: displayText, call: phoneNumber, icon });
|
|
134
|
+
return this;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* `single_select` button — opens a list picker.
|
|
139
|
+
* @param {string} title Text shown on the button that opens the list.
|
|
140
|
+
* @param {{title: string, rows: {title: string, description?: string, id: string}[]}[]} sections
|
|
141
|
+
*/
|
|
142
|
+
addSingleSelect(title, sections) {
|
|
143
|
+
if (typeof title !== 'string' || !title) throw new TypeError('addSingleSelect(title, sections) requires a non-empty title');
|
|
144
|
+
if (!Array.isArray(sections) || !sections.length) throw new TypeError('addSingleSelect(title, sections) requires a non-empty sections array');
|
|
145
|
+
this._buttons.push({ text: title, sections });
|
|
146
|
+
return this;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** Append a raw pre-built button object (bypasses the add*() shorthands). */
|
|
150
|
+
addRawButton(obj) {
|
|
151
|
+
if (typeof obj !== 'object' || obj === null) throw new TypeError('addRawButton(obj) requires a plain object');
|
|
152
|
+
this._buttons.push(obj);
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Attach the "limited time offer" banner above the buttons. */
|
|
157
|
+
setOffer({ text, url, code, expiration } = {}) {
|
|
158
|
+
this._offer = { text, url, code, expiration };
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** Collapse buttons beyond the in-thread limit into a "..." bottom-sheet menu. */
|
|
163
|
+
setOptionsMenu(buttonText, title = '📄 Select Options') {
|
|
164
|
+
if (typeof buttonText !== 'string' || !buttonText) throw new TypeError('setOptionsMenu(buttonText) requires a non-empty string');
|
|
165
|
+
this._optionText = buttonText;
|
|
166
|
+
this._optionTitle = title;
|
|
167
|
+
return this;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Mark this as a catalog/collection-backed message tied to a business JID. */
|
|
171
|
+
setBizJid(jid) {
|
|
172
|
+
this._bizJid = jid;
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Mark this as a shop-storefront-backed message. */
|
|
177
|
+
setShopSurface(surface) {
|
|
178
|
+
this._shopSurface = surface;
|
|
179
|
+
return this;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** @returns {Record<string, any>} The `sendMessage()`-shaped payload, without sending it. */
|
|
183
|
+
build() {
|
|
184
|
+
if (!this._text && !this._caption) throw new Error('NativeFlow requires setText() or setCaption()');
|
|
185
|
+
if (!this._buttons.length) throw new Error('NativeFlow requires at least one button (addUrl()/addCopy()/addCall()/addQuickReply()/addSingleSelect())');
|
|
186
|
+
if (this._caption && this._media === undefined && !this._title && !this._subtitle) {
|
|
187
|
+
throw new Error('setCaption() requires setHeader() and/or a media header (setImage()/setVideo()/setDocument())');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
...(this._media || {}),
|
|
192
|
+
...(this._text ? { text: this._text } : { caption: this._caption, title: this._title, subtitle: this._subtitle }),
|
|
193
|
+
...(this._footer !== undefined && { footer: this._footer }),
|
|
194
|
+
...(this._audioFooter !== undefined && { audioFooter: this._audioFooter }),
|
|
195
|
+
...(this._thumbnail !== undefined && { thumbnail: this._thumbnail }),
|
|
196
|
+
...(this._offer && { offerText: this._offer.text, offerUrl: this._offer.url, offerCode: this._offer.code, offerExpiration: this._offer.expiration }),
|
|
197
|
+
...(this._optionText !== undefined && { optionText: this._optionText, optionTitle: this._optionTitle }),
|
|
198
|
+
...(this._bizJid !== undefined && { bizJid: this._bizJid }),
|
|
199
|
+
...(this._shopSurface !== undefined && { shopSurface: this._shopSurface }),
|
|
200
|
+
nativeFlow: this._buttons,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** Build and send via the socket's `sendMessage()`. */
|
|
205
|
+
async send(jid, options = {}) {
|
|
206
|
+
return this.#client.sendMessage(jid, this.build(), options);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export { NativeFlow };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { BaseBuilder, generateWAMessageFromContent, prepareWAMessageMedia, generateMessageIDV2, crypto } from './shared.js';
|
|
2
|
+
class Poll extends BaseBuilder {
|
|
3
|
+
#client;
|
|
4
|
+
|
|
5
|
+
/** @param {import('../../WAProto/index.js').WASocket} client Active Baileys socket (must expose `sendMessage`). */
|
|
6
|
+
constructor(client) {
|
|
7
|
+
super();
|
|
8
|
+
if (!client) throw new Error('Socket is required');
|
|
9
|
+
this.#client = client;
|
|
10
|
+
|
|
11
|
+
this._name = '';
|
|
12
|
+
this._values = [];
|
|
13
|
+
this._selectableCount = 1;
|
|
14
|
+
this._hideVoter = false;
|
|
15
|
+
this._canAddOption = false;
|
|
16
|
+
this._toAnnouncementGroup = false;
|
|
17
|
+
this._correctAnswer;
|
|
18
|
+
this._endDate;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Set the poll question/title. */
|
|
22
|
+
setName(name) {
|
|
23
|
+
if (typeof name !== 'string' || !name) throw new TypeError('setName(name) requires a non-empty string');
|
|
24
|
+
this._name = name;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Append one option. Chainable — call repeatedly, or use `addOptions()` for an array. */
|
|
29
|
+
addOption(name) {
|
|
30
|
+
if (typeof name !== 'string' || !name) throw new TypeError('addOption(name) requires a non-empty string');
|
|
31
|
+
this._values.push(name);
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Append several options at once. @param {string[]} names */
|
|
36
|
+
addOptions(names) {
|
|
37
|
+
if (!Array.isArray(names) || !names.length) throw new TypeError('addOptions(names) requires a non-empty array of strings');
|
|
38
|
+
names.forEach((name) => this.addOption(name));
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** How many options a voter can pick (default 1). Use `setMultiSelect()` for unlimited. */
|
|
43
|
+
setSelectable(count) {
|
|
44
|
+
if (typeof count !== 'number' || count < 0) throw new TypeError('setSelectable(count) requires a non-negative number');
|
|
45
|
+
this._selectableCount = count;
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Shortcut for unlimited-choice polls (`selectableCount: 0`). Pass `false` to revert to single-select. */
|
|
50
|
+
setMultiSelect(canSelectMultiple = true) {
|
|
51
|
+
this._selectableCount = canSelectMultiple ? 0 : 1;
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Hide voter names from other participants (where the client supports it). */
|
|
56
|
+
setHideVoter(hide = true) {
|
|
57
|
+
this._hideVoter = hide;
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Allow voters to add their own options. */
|
|
62
|
+
setCanAddOption(allow = true) {
|
|
63
|
+
this._canAddOption = allow;
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Mark this a community-announcement-group poll (pollCreationMessageV2 path). */
|
|
68
|
+
setAnnouncementGroup(isAnnouncement = true) {
|
|
69
|
+
this._toAnnouncementGroup = isAnnouncement;
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Auto-close the poll at this date/time. */
|
|
74
|
+
setEndDate(date) {
|
|
75
|
+
this._endDate = date instanceof Date ? date : new Date(date);
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Turn this into a quiz: one option is marked correct. Delegates the actual hash/version
|
|
81
|
+
* wiring to the socket's own `sendMessage({poll:{...correctAnswer}})` handling — see class
|
|
82
|
+
* docblock for why this builder doesn't compute the hash itself.
|
|
83
|
+
* @param {string} correctOptionName Must exactly match one of the strings passed to `addOption()`/`addOptions()`.
|
|
84
|
+
*/
|
|
85
|
+
setQuiz(correctOptionName) {
|
|
86
|
+
if (typeof correctOptionName !== 'string' || !correctOptionName) {
|
|
87
|
+
throw new TypeError('setQuiz(correctOptionName) requires a non-empty string');
|
|
88
|
+
}
|
|
89
|
+
this._correctAnswer = correctOptionName;
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** @returns {{poll: Record<string, any>}} The `sendMessage()`-shaped poll payload, without sending it. */
|
|
94
|
+
build() {
|
|
95
|
+
if (!this._name) throw new Error('Poll requires a name (use setName())');
|
|
96
|
+
if (this._values.length < 2) throw new Error('Poll requires at least 2 options (use addOption()/addOptions())');
|
|
97
|
+
if (this._correctAnswer && !this._values.includes(this._correctAnswer)) {
|
|
98
|
+
throw new Error('setQuiz(correctOptionName) must match one of the added options exactly');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
poll: {
|
|
103
|
+
name: this._name,
|
|
104
|
+
values: this._values,
|
|
105
|
+
selectableCount: this._selectableCount,
|
|
106
|
+
toAnnouncementGroup: this._toAnnouncementGroup,
|
|
107
|
+
hideVoter: this._hideVoter,
|
|
108
|
+
canAddOption: this._canAddOption,
|
|
109
|
+
...(this._endDate && { endDate: this._endDate }),
|
|
110
|
+
...(this._correctAnswer && { pollType: 1, correctAnswer: this._correctAnswer }),
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Build and send via the socket's `sendMessage()`. */
|
|
116
|
+
async send(jid, options = {}) {
|
|
117
|
+
return this.#client.sendMessage(jid, this.build(), options);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* "Rich AI-response" style message builder: text with hyperlink/citation/latex
|
|
123
|
+
* inline entities, code blocks, tables, sources, image/video attachments,
|
|
124
|
+
* inline product/post cards, tip banners and quick-reply suggestions —
|
|
125
|
+
* everything ChatGPT/Gemini-in-WhatsApp-style bots typically render.
|
|
126
|
+
* Also exported as `AIVanzxy` / `LeafRich` / `VanzxyAI` / `VanzxyRich` (identical class, alternate names).
|
|
127
|
+
*/
|
|
128
|
+
export { Poll };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { AIRich } from './AIRich.js'
|
|
2
|
+
import { Button } from './Button.js'
|
|
3
|
+
import { ButtonV2 } from './ButtonV2.js'
|
|
4
|
+
import { ButtonV3 } from './ButtonV3.js'
|
|
5
|
+
import { Carousel } from './Carousel.js'
|
|
6
|
+
import { Poll } from './Poll.js'
|
|
7
|
+
import { A2UI } from './A2UI.js'
|
|
8
|
+
import { NativeFlow } from './NativeFlow.js'
|
|
9
|
+
import { Location } from './Location.js'
|
|
10
|
+
import { Contact } from './Contact.js'
|
|
11
|
+
import { Album } from './Album.js'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* VanzxyBaileys — unified builder hub.
|
|
15
|
+
*
|
|
16
|
+
* Semua builder tetap berada di class/file masing-masing.
|
|
17
|
+
* Class ini hanya menyediakan satu pintu masuk.
|
|
18
|
+
*/
|
|
19
|
+
class VanzxyBaileys {
|
|
20
|
+
constructor(client) {
|
|
21
|
+
if (!client) {
|
|
22
|
+
throw new TypeError(
|
|
23
|
+
'VanzxyBaileys(client) requires an active Baileys socket/client'
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
this.client = client
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// ===== AIRICH =====
|
|
31
|
+
|
|
32
|
+
airich() {
|
|
33
|
+
return new AIRich(this.client)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
vanzxyAI() {
|
|
37
|
+
return new AIRich(this.client)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
aiVanzxy() {
|
|
41
|
+
return new AIRich(this.client)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
leafRich() {
|
|
45
|
+
return new AIRich(this.client)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
vanzxyRich() {
|
|
49
|
+
return new AIRich(this.client)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
richVanzxy() {
|
|
53
|
+
return new AIRich(this.client)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ===== BUTTON =====
|
|
57
|
+
|
|
58
|
+
button() {
|
|
59
|
+
return new Button(this.client)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
buttonV2() {
|
|
63
|
+
return new ButtonV2(this.client)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
buttonV3() {
|
|
67
|
+
return new ButtonV3(this.client)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ===== CAROUSEL =====
|
|
71
|
+
|
|
72
|
+
carousel() {
|
|
73
|
+
return new Carousel(this.client)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ===== POLL =====
|
|
77
|
+
|
|
78
|
+
poll() {
|
|
79
|
+
return new Poll(this.client)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// ===== NATIVE FLOW =====
|
|
83
|
+
|
|
84
|
+
nativeFlow() {
|
|
85
|
+
return new NativeFlow(this.client)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
location() {
|
|
89
|
+
return new Location(this.client)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
contact() {
|
|
93
|
+
return new Contact(this.client)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
album() {
|
|
97
|
+
return new Album(this.client)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ===== A2UI / BLOKS =====
|
|
101
|
+
|
|
102
|
+
a2ui() {
|
|
103
|
+
return new A2UI()
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Alias PascalCase untuk developer yang suka naming class.
|
|
108
|
+
*/
|
|
109
|
+
AIRich() {
|
|
110
|
+
return this.airich()
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
Button() {
|
|
114
|
+
return this.button()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
Carousel() {
|
|
118
|
+
return this.carousel()
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
Poll() {
|
|
122
|
+
return this.poll()
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
NativeFlow() {
|
|
126
|
+
return this.nativeFlow()
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
Location() {
|
|
130
|
+
return this.location()
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
Contact() {
|
|
134
|
+
return this.contact()
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
Album() {
|
|
138
|
+
return this.album()
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
A2UI() {
|
|
142
|
+
return this.a2ui()
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { VanzxyBaileys }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { Toolkit, BaseBuilder, RowBuilder } from './shared.js';
|
|
2
|
+
export { Button, CardBuilder } from './Button.js';
|
|
3
|
+
export { ButtonV2 } from './ButtonV2.js';
|
|
4
|
+
export { ButtonV3 } from './ButtonV3.js';
|
|
5
|
+
export { Carousel } from './Carousel.js';
|
|
6
|
+
export { Poll } from './Poll.js';
|
|
7
|
+
export { NativeFlow } from './NativeFlow.js';
|
|
8
|
+
export { Location } from './Location.js';
|
|
9
|
+
export { Contact } from './Contact.js';
|
|
10
|
+
export { Album } from './Album.js';
|
|
11
|
+
export { AIRich, ORich } from './AIRich.js';
|
|
12
|
+
export { A2UI, sendA2UIWidget } from './A2UI.js';
|
|
13
|
+
export { AIRich as AIVanzxy, AIRich as LeafRich, AIRich as VanzxyAI, AIRich as VanzxyRich, AIRich as RichVanzxy } from './AIRich.js';
|
|
14
|
+
export const MESSAGE_BUILDER_VERSION = '5.0';
|
|
15
|
+
export { VanzxyBaileys } from './VanzxyBaileys.js';
|